Results 1 to 3 of 3

Thread: [Resolved]Submit button clicked?

  1. #1

    Thread Starter
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336

    [Resolved]Submit button clicked?

    I have login code that checks the DB for the Username/Password on this log in page.

    The login page is the regular 2 textbox thing with a Submit button.

    The code works but i need to be able to tell if the form was Posted by hitting the Submit button.

    I currently have the Code in the Page_Load event, so i am trying to keep the code from running every time the page loads and only have it run when the user clicks the Submit Button.

    I tried using

    If IsPostBack Then
    'do stuff
    End if

    but that doesn't work.

    In PHP you simply put

    If ($Submit) { // Where Submit is the name of the Forms Post Button
    //do stuff
    }

    I also tried putting the code in the Submit_Click event but nothing at all happens then...

    Which would be the best way to do this? I would think it would be the Click Event of the button, but why doesn't it do anything?


    I have the form posting to itself, meaning that when you click the Submit button the page basically refreshes.

    Thanks!
    Last edited by Arc; Jun 26th, 2003 at 10:15 AM.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Putting code in the button click event does work. Are you using the Web Form asp.net buttons or HTML buttons. If uing HTML buttons, you need the Web Form one.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    yah i was using an html but that i had set to runat=server. I used a button from the toolbox and it seems to work now.

    Thanks!
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


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