This is not normal behaviour if these are the steps that are happening:
- user clicks browse button (file upload 1)
- file open dialogue is displayed
- user selects file and clicks ok
- file open dialogue is closed and path is placed into text box
- user clicks browse button (file upload 2)
- file open dialogue is displayed
- user selects file and clicks ok
- file open dialogue is closed and path is placed into text box
However if these are the steps:
- user clicks browse button (file upload 1)
- file open dialogue is displayed
- user selects file and clicks ok
- file open dialogue is closed and path is placed into text box
- user clicks a button, link button, or otherwise causes a postback to the server
Then it is correct that the text is cleared from the FileUpload control.
You
cannot access the TextBox of the FileUpload control to replace the path. This is for security reasons. For instance, you could be writing code that places a path to sensitive data (like a password file or something) instead of what the user intended.
Therefore, if your page is posting back to the server, the FileUpload control will be cleared. There is no changing this behaviour.
So, again I ask, why is your FileUpload control getting cleared?
-Frinny