FileUpload.HasFile Always return false.

Hi,

I have web application, I out the webcontrols.FileUpload inside UpdatePanel.
The browse to open file is success but when read the HasFile propoerty, always return false.

Is there any problem to put FileUpload inside UpdatePanel?
How to solve this problem?

Thank you.
LVL 1
emi_sastraAsked:
Who is Participating?
 
jinn_hnnlCommented:
It's a known issues FileUpload and UpdatePanel

First thing you might wanna try, is checking the authentication to the associated folders, whether you have proper rights to access to those folder.

Sometimes it doesn't work on the first click but the after. You might want to try this code

(in the code behind, set the id for the button in Page_Load
btnFileUpload.ID = "btUpload";

Hope this helps

JINN

PS: you can refer to this link
http://forums.asp.net/t/1060363.aspx






<asp:UpdatePanel ID="upnlFileUpload" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
	<ContentTemplate>
		<asp:FileUpload ID="fileUpload" runat="server" />
		<br />
		<asp:Button ID="btnFileUpload" runat="server" Text="File Upload" OnClick="btnFileUpload_Click" />
	</ContentTemplate>
	<Triggers>
		<asp:PostBackTrigger ControlID="btnFileUpload"/>
	</Triggers>
</asp:UpdatePanel>

Open in new window

0
 
emi_sastraAuthor Commented:
Hi jinn_hnnl,

I will try it first.

Thank you very much for your help.
0
 
jinn_hnnlCommented:
Yes, try and tell me if it works or you need further assistance ^^

JINN
0
 
emi_sastraAuthor Commented:
Hi JINN,

It works.

Thank you very much for your help.
0
 
jinn_hnnlCommented:
Well done, Glad to help

JINN ^^
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.