Author: brgdotnet | Posted on: 2/20/2010 1:40:43 PM | Views : 1932

How do I pre-populate a FileUpload control on a web form from my C# code?

You see, I have a web form with a FileUpload text box control. This control allows the application user
to select the name of the file to be uploaded. Here is some of my Default.Aspx code:
<td>
    <asp:FileUpload id="fileUpload1" runat="server" Wideth="300" />
</td>

Now after the file is chosen, the web application will be redirected to a second web
form/page Second.aspx. The second web form will also have a file upload control which is about the same as the one in Default.aspx.
What I want to do is to pre-populate the second.Aspx FileUpload control with the fileUpload
object from the first web form so that the application user does not have to chose the filename
a second time. That way the filename will automatically appear in the fileUpload text box in
the second pa ...

Go to the complete details ...