I’ve been working with the Microsoft AJAX toolkit recently (and not so much Windows Mobile – hence lack of update
. It’s an amazing framework for people who don’t know much JavaScript but still would like to do some AJAX style web programming (like me). However since it involves a combination of .NET server side programming, HTML and client side JavaScript figuring out what’s wrong when something doesn’t work can be tricky. I’ll try to post a few tricks I found (mostly on ajax.asp.net :) even though it’s not directly related to mobile programming.
The ASP.NET FileUpload control doesn’t work within an AJAX UpdatePanel by default (when the upload button you create is inside the same panel). This is because a file cannot be uploaded asynchronously. To be able to upload a file the easiest solution is to make a complete postback when the user uploads a file. To do this add a PostBackTrigger on the button:
<asp:UpdatePanel>
<ContentTemplate>
<asp:Button ID="ButtonUploadFile"
runat="server" Text="Upload" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ButtonUploadFile" />
</Triggers>
</asp:UpdatePanel>
(note that it is not an AsyncPostBackTrigger)
May 29, 2007 at 2:00 pm
Hi,
The first time, upload not function, why ?
March 20, 2008 at 5:11 am
Hi,
Try this
in place of
Let me know if you further face some problem.
Bye
ALI
March 20, 2008 at 5:14 am
Hi,
Try this
in place of
Previously I copied and paste but not shown in above, as you can see.
Bye
May 21, 2008 at 7:47 pm
in response to vpanta, take a look at this, worked for me….
http://marss.co.ua/FileUploadAndUpdatePanel.aspx
June 19, 2008 at 3:31 am
Somehow i missed the point. Probably lost in translation
Anyway … nice blog to visit.
cheers, Grozny.
August 5, 2008 at 7:11 am
this is not working
when we browse file
after 20 second these are lost
please send me solution.
Thanks in advance
August 12, 2008 at 9:45 pm
thanks for this post !
November 13, 2008 at 3:17 pm
$columns[4]
February 3, 2009 at 4:14 am
this is crap! It doesn’t work at all!!!
March 22, 2009 at 5:30 am
FYI, someone is ripping off your post man:
http://www.mehmetcatkin.com/post/2008/01/FileUpload-and-Ajax-UpdatePanel.aspx