Results 1 to 5 of 5

Thread: Multiple buttons on a form??

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Multiple buttons on a form??

    I have 2 asp.net buttons. One submits the form but I want the other button
    to execute some code without submitting the form.

    Is this possible and if so how?

    Parksie

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    You just put the code in the click event, and let the event return on it's own. Nothing special you have to do. The page will look like it was submitted, but it will just load up again with the same values as before (except password fields). On the actual submit button, you will process your code, then redirect the user to another page.

    If you don't want the page to refresh (go back to the server to run the code), you are going to have to write the code in javascript or vbscript inside the pages html so it won't post back to the server to run the code.

  3. #3
    Member Ooogaleee's Avatar
    Join Date
    Nov 2002
    Location
    Jacksonville, FL
    Posts
    52
    ...and don't forget to put your non-submit button's commands in a "If Is NotPostBack Then..." block.

  4. #4

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    I dont think it will work as Dreamweaver MX operates in a wierd fashion compared to Visual Studio.net.

    Parksie

  5. #5
    Fanatic Member Redth's Avatar
    Join Date
    May 2001
    Location
    Ontario, Canada
    Posts
    551
    dreamweaver MX is the devil when it comes to asp.net ... well, i suppose it works, but i don't like it one bit compared to vs.net

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width