Reputation: 1147
I am using the following code to upload the file
<asp:UpdatePanel ID="UpdatePanel18" runat="server">
<ContentTemplate>
<asp:FileUpload runat="server" ID="fuImage1" />
<asp:Button runat="server" ID="btnUpload1" Text="Upload"
onclick="btnUpload1_Click" />
<asp:ImageButton ID="btnGetImage1" ImageUrl="images/cam.png" Height="25px"
Width="25px" runat="server" onclick="btnGetImage1_Click" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btnUpload1" />
</Triggers>
</asp:UpdatePanel>
When i select a file to upload, path is not getting displayed on the file upload control. Need help to fix this problem
Upvotes: 1
Views: 3836
Reputation: 4845
This should work
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="conditional">
<Triggers>
<asp:PostBackTrigger ControlID="Button1" />
</Triggers>
<ContentTemplate>
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button1" runat="server"Text="Upload" OnClick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
Upvotes: 0
Reputation: 85056
This is a frustrating feature of the update panel. Give this post a read which goes over the cause of this issue as well as a resolution:
http://geekswithblogs.net/mmintoff/archive/2009/04/01/fileupload-within-updatepanel.aspx
Upvotes: 4