.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

FileUpload issue with UpdatePanel

Posted By: san     Posted Date: January 18, 2010    Points:2   Category :ASP.Net
Hi Everyone,
I have two scenarios
1. I have asp fileupload control in my form,and also I have button(1st), when I select a file and clicked on the button(1.e. 1stbutton) then I should open a modalPopup (the popup will open based on few condtions so I had to go with server side code), on that Popup there is a button(2nd) onclik of that button(i.e. 2nd button) I have to save the selected file.

2. On the other condition popup will not open at that Time I have to save the file onclick of 1st button itself at that time also am unable to read the filename.

I tried to keep the button and modalpopup inside one updatepanel the selected file is visible in the fileupload control but am unable to read the filename it is showing null in both the scenarios.

Author: Amit Mehra             
Posted Date: January 18, 2010     Points: 5   


You can not assign the value in the fileupload control. So you can not that.

Now you have the choice that read the filename and assign the value into ViewState while opening the Pop window using JavaScript and pass the file detail to the popup to display to the user. and when user press the 2nd button you can save the file by taking the file value from ViewState.

Hope this will give you an idea.


Please "Mark As Answer " if this post help you.
Author: san             
Posted Date: January 19, 2010     Points: 5   

Hi Amit,
Yes we can do the way which u suggest but the situation here is that the popup has to open by running the server side code only because am running a procedure to check the condition for popup open.
And the other thing is I will not always save the selected file when the popup opens i.e. on Popup there is one more button called Cancel it just closes the popup at that time I should show the Selected file in the upload Control!!!

So I think that will not work out as we cant assign the value to upload as we know!!


Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend