|
Wire up the handler to the Click event, not Command.
|
|
|
|
|
It does not work either. Neither the Click or the Command event gets fired. I forgot to write, that I've tried the Click event as well.
Btw. the both the command event and the click event should be fired when the ImageButton is clicked. The Command Event gives me the benefit of having access to the CommandArgument, which can tell me the id of the file to be deleted. The click event cannot.
Best Regards
Soeren
|
|
|
|
|
Try this:
imgb.Command += new CommandEventHandler(this.DeleteFile);
EDIT
-------------
nm, saw you tried it with new as well...
Does it even do a post back?
Try setting the AutoPostBack property to true;
|
|
|
|
|
It does produce a postback. I've even tried setting the PostBackUrl property, even though it should not be necessary.
My theory is that I forgot to set some property that makes the ImageButton fire its events, but I can't find out which property it is. It makes no sense.
Best Regards
Soeren
|
|
|
|
|
Hi, to all...
In my project i open outlook page for new message, in subject i set some text (using C#) but in body i want to draw table (to set number of rows and columns using C#, this table should be same as we draw in MSWord. Hope I was clear).
|
|
|
|
|
hi,
is there any way to fill a GridView with the contents of a DataTable object? The object is correct, can see the values etc, but how do i display them in a GridView???
thanx
|
|
|
|
|
Can't you just set the datasource of the gridview to be the datatable, and call databind ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thank you for this! i'm very new to it, i thought you should have a datasource object for that, but as you said, datatable + bind worked great!
thank you
|
|
|
|
|
Is it possible to modify this control so that you supply it with an email address rather than your username?
Thanks,
|
|
|
|
|
It's default is with mail, so where do you think it will send the recovery options ?
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
Sorry I might not have explained it very well.
It will send you your email but first you have to supply the control with your username, then it will send you your password.
I want to change this and have the user supply their email address then have the password sent to that email address, of course being that the email address is in the DB. Also my membership has requiresUniqueEmail="true" so there will be no duplicate email addresses.
|
|
|
|
|
Noway, you must provide the username, I think it might be a way through the administrator tool.
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
What is the max file size limit that can be uploaded by File Upload control?
Can u give code to set the maximum file size in File Upload control?
Thanks and Regards,
sdaniel_cst
|
|
|
|
|
The maximum file size is controlled via config file. The maximum size for .NET1/1.1 is 1GB. For .NET2 it is 2GB. By default, the size is 4096K (4MB). To change the size, you specify the following:
<httpRuntime maxRequestLength="value in K" executionTimeout="3600" />
It is not a good idea to let this value get too big because ASP.NET loads the item into memory as it is uploading, so large values quite often result in Out of Memory exceptions.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks very much for your reply...
sdaniel_cst
|
|
|
|
|
If user is uplaoding large file through the application, then i want to allow them to do other work on the site. Means if a thread is processing file uplaod functionality then i want them to allow other works on the appllication.
Problem in Asynchronous call:
In this solution, i tried to execute, uploading functionality in to separate thread. For that, I created separate thread using delegate.BeginInvoke() method. Now, problem is that, In asynchronous call, I am able to upload file only in that case, when response from main thread is not returned. Once a response from main thread generated and sent back to the client then second thread gets “file not found” exception.
Problem in Popup window:
If i use popup window to open "file upload page", then that page will open in new window. Now, problem is that, if any processing is happening in this page at server side and user tries to do different things on other window (make a call to execute on the server e.g.. Click on “Cancel” link) then processing of this request queued until processing of "Upload File" page is not completed. Means request are performed sequentially.
I want them to allow user to do different task at the same time.
I am using ASP.NET 1.1.
If some one has any solution them please do the needful.
Thanks
Lokesh Gupta
.Net Developer
|
|
|
|
|
The reason that you can't do anything else while the file is uploaded, is that the web server only allows one page at a time to run for each user.
The solution is to disable SessionState for one of the pages.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Hi Guffa,
Thanks for updating me.I tried it in sample application and it worked fine. I found that, two saperate pages processed simultanenously using different threads.
But when i tried it in my application, it didn't worked.
I disabled sesionState for "Upload File" page, which open in popup window. Now, if uploading is going on and at the same time, if i wanted to do different things on different pages, then i found that, request were queued. I am not getting, where i am going wrong. Can you guess, what other settings may cause this to not happend?
Is there any other way to achieve the same without disabling the SessionState?
Means by managing threads in code.
Thanks
Lokesh Gupta
|
|
|
|
|
lokeshgupta13 wrote: Thanks for updating me.I tried it in sample application and it worked fine. I found that, two saperate pages processed simultanenously using different threads.
Then one of them is not processing the page any more, just running in the background. Once you end the response, it doesn't matter if you have a thread running in the background. This of course means that the background thread can't send anything to the browser any more, as the response has ended.
lokeshgupta13 wrote: I disabled sesionState for "Upload File" page
Is that the page containing the upload form, or the page that is recieving the file? Or are they the same? The page recieving the file has to be sessionless, as that's the one running while the file is uploading.
I have myself written an upload application that used a sessionless page for displaying upload progress, so I know that it's possible to do it this way.
lokeshgupta13 wrote: Is there any other way to achieve the same without disabling the SessionState?
Not unless you can get rid of the single page limitation in the IIS, but I really doubt that is possible. That could introduce threading issues, as you will have several threads running against the same session object. Also it would make the server much more sensetive to DoS attacks.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
In my case both the "Upload Form" and "Receiving form" are the same. I am using same form. I am not getting what is going wrong.
Thanks
|
|
|
|
|
Have you verified that trying to access the Session object in the page gives an excception, so that you are sure that the page is session-less?
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Yes, i tried and it throughs an exception.
|
|
|
|
|
i am using vs2003
i want to write some text into an existing file present at server side using asp.net but it gives me an exception named
----->System.UnauthorizedAccessException: <------
so i need how to get permission to write file to server
any suggestions are also welcome
the code i used is given below---
Dim fs As New FileStream("C:\Inetpub\wwwroot\wa_readfromcsv\textfile_as_csv.txt", FileMode.Create, FileAccess.Write)
Dim s As New StreamWriter(fs)
s.WriteLine("This is an example of using file handling concepts in VB.NET.")
s.WriteLine("This concept is interesting.")
s.Close()
------- the exact error shown is ---------
' Exception Details: System.UnauthorizedAccessException:
' Access to the path "C:\Inetpub\wwwroot\wa_readfromcsv\textfile_as_csv.txt" is denied.
'ASP.NET is not authorized to access the requested resource.
'Consider granting access rights to the resource to the ASP.NET request identity.
'ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5
'or Network Service on IIS 6) that is used if the application is
'not impersonating. If the application is impersonating via <identity impersonate="true">,
'the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
'To grant ASP.NET write access to a file, right-click the file in Explorer,
'choose "Properties" and select the Security tab.
'Click "Add" to add the appropriate user or group.
' Highlight the ASP.NET account, and check the boxes for the desired access.
thanks in advance for your help and time...
|
|
|
|
|
The error message tells you what you need to do. Basically, the ASPNET user does not have write permissions for this directory. You need to grant this user permissions to the directory. Follow the instructions in the error for granting ASPNET access.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: The error message tells you what you need to do
There are none so blind as those who will not see.
|
|
|
|