Avoiding postback on upload control when another button is clicked

Discussion in 'ASP .Net' started by SBK, Sep 3, 2007.

  1. SBK

    SBK Guest

    Hi All,

    Got a quick problem, hoping someone can help me out here.

    Using an Upload Control. If a file to upload is specified and another form
    action is committed (i.e. btnBack) then the upload control will still post
    the file but not call the event.

    Anything I can do to prevent this?

    Thanks in advance.
    SBK, Sep 3, 2007
    1. Advertisements

  2. SBK

    bruce barker Guest

    as the value can be cleared, in client script disable the upload control
    via the onclick event of the buttons you don't want to post the file.
    the browser will not post disabled fields.

    -- bruce (sqlwork.com)
    bruce barker, Sep 3, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.