Check for button click in page load...

Discussion in 'ASP .Net' started by Bob Erwin, Jul 2, 2003.

  1. Bob Erwin

    Bob Erwin Guest

    Hey,

    I have an interesting problem that I need some assistance for...

    It is my understanding that when you click a button on an ASP.NET page, it
    will actually run the page load first and then run my button procedure. Is
    there a way, that I can check to see if the button was clicked in the *page
    load* before the code ever gets to my button procedure?

    Mainly, I have some dynamic textboxes that I need to reset if a person
    selects a radiolist, however, if they select the submit button, I don't want
    to reset the textboxes.

    Thanks for your help,
    Bob
    Bob Erwin, Jul 2, 2003
    #1
    1. Advertising

  2. Bob Erwin

    Natty Gur Guest

    Hi,

    1) If you look at the Form.Keys collection you will found only the
    Button ID
    that cause the postback.

    2) RaisePostBackEvent is a method that you need to overload :
    override protected void RaisePostBackEvent ( IPostBackEventHandler
    sourceControl,
    string eventArgument)
    {
    string s ((WebControl)sourceControl).ID ;
    }


    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur, Jul 2, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Purvi T
    Replies:
    0
    Views:
    830
    Purvi T
    Oct 19, 2004
  2. Samy
    Replies:
    2
    Views:
    1,352
  3. Amy
    Replies:
    0
    Views:
    976
  4. GauravGupta
    Replies:
    4
    Views:
    2,100
    Shilpa1234
    Jan 19, 2012
  5. GauravGupta
    Replies:
    2
    Views:
    1,648
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jul 1, 2007
Loading...

Share This Page