How to prevent FileUpload from uploading on Prev click in a wizard?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bogdan

    How to prevent FileUpload from uploading on Prev click in a wizard?

    Hi,

    I have a FileUpload control on the last step in a wizard control. I'd like
    the control to upload the file only when the Finish button is clicked
    (present on the last step). Unfortunately the control also uploads the file
    when the Previous button is clicked. I'm assuming that this is because the
    page is posted-back (submitted) to the server.
    Is there a way to change that behaviour?

    Thanks,
    Bogdan


  • Peter Bucher [MVP]

    #2
    Re: How to prevent FileUpload from uploading on Prev click in a wizard?

    Hello Bogdan
    Is there a way to change that behaviour?
    No - not directly

    The upload is started by the client when a postback occours.
    On the serverside is the upload allready done, and you can choose wheter to
    save or not.....
    So you have to interact on clientside.

    For example:
    use (javascript: history(-1);) or similar.
    delete your <input type="file.... with help of the DOM

    --
    Gruss, Peter Bucher
    Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
    http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
    http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET

    Comment

    Working...