Solved

FileUpload.HasFile Always return false.

Posted on 2008-10-24
5
8,221 Views
Last Modified: 2012-05-05
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.
0
Comment
Question by:emi_sastra
  • 3
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
jinn_hnnl earned 500 total points
ID: 22794586
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
 
LVL 1

Author Comment

by:emi_sastra
ID: 22794651
Hi jinn_hnnl,

I will try it first.

Thank you very much for your help.
0
 
LVL 10

Expert Comment

by:jinn_hnnl
ID: 22794666
Yes, try and tell me if it works or you need further assistance ^^

JINN
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 22794723
Hi JINN,

It works.

Thank you very much for your help.
0
 
LVL 10

Expert Comment

by:jinn_hnnl
ID: 22794735
Well done, Glad to help

JINN ^^
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
vb.net 2 37
asp.net mvc input file 2 32
LINQ - C# to VB convertion 12 46
Help with solving error related to resources file 4 35
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now