Assisted Solutions Forums

Welcome! These forums provide help and documentation for our products and services.
Welcome to Assisted Solutions Forums Sign in | Join | Help
in Search

more than one submit button on page

Last post 03-27-2008, 7:27 AM by ChrisHynes. 1 replies.
Sort Posts: Previous Next
  •  03-26-2008, 1:15 PM 4009

    more than one submit button on page

    On the same page where I have the upload control I have two buttons. One that has no OnClick or other wire-up which is supposed to act as the 'Upload' button, and one that has an OnClick event that does something unrelated to the upload control. If I choose 'Browse', select a file and click the second button, the upload still goes forward. Is there any way to explicitly specify which button should act as the Upload button?

    I don't want to have to check the sender in OnUploadComplete, b/c I don't want the user to see any progress bar at all. Seems like a very simple issue. Am I missing something?

  •  03-27-2008, 7:27 AM 4011 in reply to 4009

    Re: more than one submit button on page

    Are both buttons posting back? Unfortunately, the browser will upload the entire page in one chunk when you post. You

    The only thing you can do is to use the AutoUploadOnPostBack property to disable automatic form submission, and call the SlickUpload_Submit() function in the onclick of your upload button. But that means that if a user selects a file, then clicks the other button instead of the upload button, they will loose the file they selected and have to choose it again. Will that work for your scenario?

    Note: if you're using a asp:Button server control, with the OnClientClick property, it should read:

    OnClientClick="SlickUpload_Submit();return false;"

    so as to escape out of the ASP.NET submit code.

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems