Solved

FileUpload.HasFile Always return false.

Posted on 2008-10-24
5
8,102 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
Comment Utility
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
Comment Utility
Hi jinn_hnnl,

I will try it first.

Thank you very much for your help.
0
 
LVL 10

Expert Comment

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

JINN
0
 
LVL 1

Author Comment

by:emi_sastra
Comment Utility
Hi JINN,

It works.

Thank you very much for your help.
0
 
LVL 10

Expert Comment

by:jinn_hnnl
Comment Utility
Well done, Glad to help

JINN ^^
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 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

9 Experts available now in Live!

Get 1:1 Help Now