locked
Is it possible to keep the file name in the fileupload after postback RRS feed

  • Question

  • User-587754273 posted
    I have a web form that contains several fileupload controls. For each fileuplaod, I have file extension validation in the code behind. If any of file extension is in the exclusion list, I will give an error message and remind user to re-select a file to upload.

    But the strange thing is after postback, all the file names in those fileupload controls are disappear. The viewstate is set to true for all the fileupload controls.

    Is any way to keep file name in the fileupload control after postback? Or is any third party controls can do this?
    Thanks,
    Tuesday, June 27, 2006 12:06 AM

All replies

  • User541108374 posted

    Hi,

    that's because the property is a readonly property. You can't set directly. You could try it with the FileUpload1.Attributes.Add method.

    Grz, Kris.

    Tuesday, June 27, 2006 2:01 AM
  • User-587754273 posted
    but what attribute that I can use to set my file name to the fileupload control?
    Thanks,
    Wednesday, June 28, 2006 12:35 AM