I have a file upload control in my form . When i put it inside an UpdatePanel and choose a file through Fileupload control it shows "Control has no file selected".
When i do the same thing outside/Without Update Panel it works fine.
As far as I know, you cannot use asp:FileUpload inside an update panel. asp:FileUpload requires a full post back in order to upload a file. But asp:UpdatePanel do a partial post back. Try
AJAX file uploader.
Manish Kr. P...
Member
14 Points
21 Posts
FileUpload not working properly inside UpdatePanel.
May 08, 2012 08:53 AM|LINK
I have a file upload control in my form . When i put it inside an UpdatePanel and choose a file through Fileupload control it shows "Control has no file selected".
When i do the same thing outside/Without Update Panel it works fine.
Pls give any solution...
Thanks
tusharrs
Contributor
3230 Points
668 Posts
Re: FileUpload not working properly inside UpdatePanel.
May 08, 2012 08:56 AM|LINK
http://www.aspsnippets.com/Articles/Using-FileUpload-Control-inside-ASP.Net-AJAX-UpdatePanel-Control.aspx
you have to use postback trigger of updatepanel
<asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:FileUpload ID="FileUpload1" runat="server" /> <asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick = "Upload_File" /> </ContentTemplate> <Triggers> <asp:PostBackTrigger ControlID = "btnUpload" /> </Triggers> </asp:UpdatePanel>( Mark as Answer if it helps you out )
View my Blog
santosh.jagd...
Star
7625 Points
1454 Posts
Re: FileUpload not working properly inside UpdatePanel.
May 08, 2012 08:57 AM|LINK
http://forums.asp.net/p/1105208/1689084.aspx
MCP
Manish Kr. P...
Member
14 Points
21 Posts
Re: FileUpload not working properly inside UpdatePanel.
May 08, 2012 10:01 AM|LINK
Sorry But its not working.....
tusharrs
Contributor
3230 Points
668 Posts
Re: FileUpload not working properly inside UpdatePanel.
May 08, 2012 10:37 AM|LINK
post your whole code design and code behind
( Mark as Answer if it helps you out )
View my Blog
Suresh94 u
Member
5 Points
25 Posts
Re: FileUpload not working properly inside UpdatePanel.
May 08, 2012 12:00 PM|LINK
Page.Form.Attributes.Add("enctype", "multipart/form-data");
....
Write this in Page Load it works!!!
Don't forget to mark as answer
christiandev
Star
8607 Points
1841 Posts
Re: FileUpload not working properly inside UpdatePanel.
May 08, 2012 12:14 PM|LINK
Does the FileUpload control need to be in an update panel ?
Regards, Christiandev (@chrisdev80), MCPD Web (2 & 4) & MCTS Windows (www.ScoreDonkey.com)
amit.jain
Star
11225 Points
1815 Posts
Re: FileUpload not working properly inside UpdatePanel.
May 08, 2012 12:14 PM|LINK
you need to use
refer http://www.csharpaspnetarticles.com/2012/04/fileupload-control-updatepanel-ajax.html
btw you can use ajax asyncFileUpload control or jquery uploadify or multiple file upload plugin
amiT jaiN
ASP.NET C# VB Articles And Code Examples
Ruchira
All-Star
42904 Points
7022 Posts
MVP
Re: FileUpload not working properly inside UpdatePanel.
May 08, 2012 12:18 PM|LINK
Hello,
As far as I know, you cannot use asp:FileUpload inside an update panel. asp:FileUpload requires a full post back in order to upload a file. But asp:UpdatePanel do a partial post back. Try AJAX file uploader.
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.