hello there...your article is very simple and useful...thanks a lot 
My point is that i want to keep the name of the file users upload like that:
<asp
criptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Width="134px"></asp:Label>
<asp
utton ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<input id="readFile" type="file" runat="server" size="35" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<img src="1.gif" alt="Loading"/>
Updating Page ......
</ProgressTemplate>
</asp:UpdateProgress>
the file name returns me Object reference not set to an instance of an object. But when i move <asp
utton ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> out of <ContentTemplate> then file name returns me the right name but then...the image doesn't appear.
The code i use to keep file's name(vb)-(it's ok) :
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim test As String = ""
test = readFile.PostedFile.FileName
End Sub
thanks in advance

My point is that i want to keep the name of the file users upload like that:
<asp
criptManager ID="ScriptManager1" runat="server" /><asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Width="134px"></asp:Label>
<asp
utton ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /><input id="readFile" type="file" runat="server" size="35" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<img src="1.gif" alt="Loading"/>
Updating Page ......
</ProgressTemplate>
</asp:UpdateProgress>
the file name returns me Object reference not set to an instance of an object. But when i move <asp
utton ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> out of <ContentTemplate> then file name returns me the right name but then...the image doesn't appear.The code i use to keep file's name(vb)-(it's ok) :
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim test As String = ""
test = readFile.PostedFile.FileName
End Sub
thanks in advance
Have you tried using the <asp:FileUpload> server control? That's what it's there for 
Also, you might need to define the button as a trigger for the UpdatePanel, as described in this article: http://ajax.net-tutorials.com/controls/updatepanel-control/

Also, you might need to define the button as a trigger for the UpdatePanel, as described in this article: http://ajax.net-tutorials.com/controls/updatepanel-control/
thanks for your quick response!
I follow your steps but nothing...
<form id="form1" runat="server" enctype="multipart/form-data" >
<asp
criptManager ID="ScriptManager1" runat="server" />
<div style="text-align: center">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" updatemode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Width="134px"></asp:Label><br />
<br />
<asp
utton ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:FileUpload ID="FileUpload1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<img src="1.gif" alt="Loading"/>
Updating Page ......
</ProgressTemplate>
</asp:UpdateProgress>
</form>
Unfortunately the file name returns me again:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim name As String = ""
name = FileUpload1.PostedFile.FileName
End Sub
"Object reference not set to an instance of an object"....
Any other ideas????
I follow your steps but nothing...<form id="form1" runat="server" enctype="multipart/form-data" >
<asp
criptManager ID="ScriptManager1" runat="server" /><div style="text-align: center">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" updatemode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Width="134px"></asp:Label><br />
<br />
<asp
utton ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /><asp:FileUpload ID="FileUpload1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<img src="1.gif" alt="Loading"/>
Updating Page ......
</ProgressTemplate>
</asp:UpdateProgress>
</form>
Unfortunately the file name returns me again:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim name As String = ""
name = FileUpload1.PostedFile.FileName
End Sub
"Object reference not set to an instance of an object"....
Any other ideas????
Hi Tom,
After searching the web for a bit, this seems like a general problem, with the upload control not really working with an UpdatePanel. So far, there doesn't seem to be a solution, so I think you may have to do this another way.
After searching the web for a bit, this seems like a general problem, with the upload control not really working with an UpdatePanel. So far, there doesn't seem to be a solution, so I think you may have to do this another way.
Thanks...I've searched too...but how could i do this in another way???i'm stacked here......

hi again...i've found a solution -unfortunately it doesn't work for me...because i use master page,but i put here...maybe someone needs it
http://aspalliance.com/1442_Building_AJAX_Enabled_File_Uploading_System_with_Progress_Bar_Using_ASPNET_20.all
if you find something for me..plz let me know...
http://aspalliance.com/1442_Building_AJAX_Enabled_File_Uploading_System_with_Progress_Bar_Using_ASPNET_20.all
if you find something for me..plz let me know...