|
As crazy as it sounds, I've had problems with File IO and my solution was to introduce a sleep(1000) in the loop after closing the file. It worked for me.
Give it a shot.
|
|
|
|
|
Hi,
I have an HTML element defined as :
<textarea id="txtOrdersNotResult" runat="server" rows="5" cols="15" visible="false"></textarea>
when certain condition hold true, it triggers the textarea to be visible. Then it should set a value in this area, like
txtOrdersNotResult.Value = "this is a test"
I have also tried,
txtOrdersNotResult.InnerText = doesnotexist.ToString();
this area is empty.
any ideas?
|
|
|
|
|
You shared your requirement and not the issue you are facing while implementing it.
Now 2 things:
1. Don't use visible attribute. It will not even render the control and thus will not be accessible through JavaScript. Use style attribute 'display'
style="display:none" , set it to display:block to show.
2. to set the value in it, use attribute value (starts with small V)
txtOrdersNotResult.value = "this is a test"
Hope both the tips should be enough for you to implement it.
|
|
|
|
|
I don't think he's talking about javascript, does he?
Help people,so poeple can help you.
|
|
|
|
|
Ali Al Omairi(Abu AlHassan) wrote: he's talking about javascript, does he?
Yes, he is. See the reference of InnerText (which clearly tells it's JS)
|
|
|
|
|
|
Yep.
|
|
|
|
|
Sir;
You said:
when certain condition hold true, it triggers the textarea to be visible.
Please elaborate or show me your code.
Help people,so poeple can help you.
|
|
|
|
|
Thank you for all your help!
This web application is written in C#, I should have specified that. So, the small and big "V" would not have been an issue.
Also, "InnerText" is a property of of the textarea. Not Javascript.
Solved this problem by using an asp:Literal tag.
Thank you!
|
|
|
|
|
so, your problem was that the tag
<textarea id="TextBox1" runat="server" ></textarea>
generates an object of type HTMLGenericControl.
when the page is first loaded, the server want mention the control in the response if TextBox1.Visible is set to false, nor in the viewstate. So, when the TextBox1.Visible is set again to true on the button click request the server wont load TextBox1's properties of TextBox1 from the request so they need to be set again.
Help people,so poeple can help you.
|
|
|
|
|
Hi all,
m having problem with the following code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim a As New DataSet1.TasksDataTable()
Dim adp As New DataSet1TableAdapters.TasksTableAdapter
adp.Fill(a)
GridView1.DataSource = a
GridView1.DataBind()
GridView1.Visible = True
End Sub
I created a dataset in visual studio by drag n drop. It has got two tables: Tasks and Reply. I saved the dataset by name Dataset1.xsd.
The problem is that the gridview doesn't show up at all. without throwing any errors.
please help.
|
|
|
|
|
Resolved! In GridView
it was AutoGenerateColumns="False"
I changed it to AutoGenerateColumns="True"
.........
Silly Mistake!
|
|
|
|
|
Hello All,
I'm try to show images from database in a client side, but, I have been using many kinds of examples that I found and none work, none of the images shown. The last example I saw it's this:
Auto-bind byte[] to asp:Image[^]
I understand perfectly the example, but the images are still not displayed.
Someone help me a bit with this issue?
In summary, I'm use a HTML5 drag & drop files. Send the files via XMLHttpRequest in a FormData object. One handler take this files in byte() and store in SQL DataBase.
Client code:
$("#btnUploadFile").click(function () {
if (files.length <= 0) {
alert("Debe seleccionar algún fichero para subirlo.");
} else {
var expID = $("#ContentPlaceHolder1_hfExpId").val();
var formData = new FormData();
for (var i = 0; i < files.length; i++) {
alert(files[i].name);
formData.append('file', files[i]);
}
var xhr = new XMLHttpRequest();
xhr.open('POST', "FileHandler.ashx", true);
xhr.overrideMimeType('text/plain; charset=x-user-defined-binary');
xhr.setRequestHeader("ExpedienteID", expID);
xhr.onload = function () {
if (xhr.status === 200) {
RefreshFilePanel();
} else {
console.log('Something went terribly wrong...');
}
};
xhr.send(formData);
};
Handle code:
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim documentBytes As Byte()
Dim lExpId As String = context.Request.Headers("ExpedienteID")
Dim fLenght As Integer
If (context.Request.Files.Count > 0) Then
Dim files As HttpFileCollection = context.Request.Files
For i = 0 To files.Count - 1
fLenght = files(i).ContentLength
documentBytes = New Byte(fLenght - 1) {}
context.Request.InputStream.Read(documentBytes, 0, fLenght)
UploadDocumentBy_ExpID(documentBytes, files(i).FileName, "Description" & lExpId.ToString, lExpId)
Next
End If
End Sub
More late, I try to put this byte() in a image tag on grid.
aspx code:
<asp:GridView ID="grdDocumentoByExp" runat="server" AutoGenerateColumns="false" Width="250px"
DataSourceID="dtsDocumentByExpId">
<Columns>
<asp:BoundField DataField="Archivo" HeaderText="Archivo" />
<asp:BoundField DataField="docId" HeaderText="docId" />
<asp:BoundField DataField="Documento" HeaderText="Documento" Visible="false" />
<asp:TemplateField HeaderText="Preview">
<ItemTemplate>
<asp:Image
ID="imgThumb"
runat="server"
ImageUrl='<%# GetImage(Eval("Documento")) %>'
/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
And the function GetImage in codebehind:
Public Function GetImage(image As Object) As String
Return "data:image/gif;base64," & Convert.ToBase64String(DirectCast(image, [Byte]()))
End Function
In all steps, there is no error, but I think that the error is posible located in the byte() file format..but i'm not sure.
Someone help me?
Sorry for my inglish and Thanks.
|
|
|
|
|
does your image really have the content type of 'image/gif'? (in other words does it have the extension .gif? )
Help people,so poeple can help you.
|
|
|
|
|
|
Please do not do this. If anyone has an answer to your question they will post it. If no one has an answer to your question then you are out of luck and will have to try debugging it yourself. Remember that people here offer advice and help in their own time, and at no cost to you, and many of them already have full-time jobs to do during the day.
Use the best guess
|
|
|
|
|
|
Hi,
I'm working on a school managment web application i want to use a html5/css3 login page but i have to verify if the login and password matches the login and password on the database(SQL Server), if the login or the password do not match i have to show a tooltip on the same web page but i don't know how
Please Help Me
Thank You!
modified 7-Mar-22 21:01pm.
|
|
|
|
|
|
You'll have to call a webservice passing in the values submitted. jQuery has an .ajax method which makes calling web services easy. See http://api.jquery.com/jQuery.ajax/[^]
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
As per me you can use Jquery Ajax post and check autentication from SQL Db
|
|
|
|
|
Thank you all for the help i'll use AJAX wit SQL DB
modified 7-Mar-22 21:01pm.
|
|
|
|
|
When i try to open the "Web.SiteMap file in My C# (Asp.net), its getting error as :
"Value does not fall within the expected range".
Due to this issue unable to change Web.SiteMap.
I've been scratching my head with no luck.
|
|
|
|
|
Deleted the .suo file found in the solution main directory and see if that helps.
|
|
|
|
|