Button click event handler

Discussion in 'ASP .Net Web Controls' started by Patrick, Jan 17, 2004.

  1. Patrick

    Patrick Guest

    I am confused...I have a form with a button on it. when it is clicked, the Page_Init and Page_Load functions are called, THEN the button handler is called. I need to handle the click PRIOR to the Page_Init and Page_Load so that I can setup some dynamic controls in the Page_Init that are created as a result of the click event. How would I do this?
    Patrick, Jan 17, 2004
    #1
    1. Advertising

  2. Hi Patrick,

    You can't change the order in which events are fired. As you have noted,
    postback events will always fire after Init and Load. Any code that depends
    on some values updated by a click event should run in an event that fires
    after it, i.e. PreRender.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup

    "Patrick" <> wrote in message
    news:...
    > I am confused...I have a form with a button on it. when it is clicked,

    the Page_Init and Page_Load functions are called, THEN the button handler is
    called. I need to handle the click PRIOR to the Page_Init and Page_Load so
    that I can setup some dynamic controls in the Page_Init that are created as
    a result of the click event. How would I do this?
    Victor Garcia Aprea [MVP], Jan 17, 2004
    #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:
    831
    Purvi T
    Oct 19, 2004
  2. sonic
    Replies:
    1
    Views:
    536
    John Saunders
    Jan 7, 2005
  3. Amy
    Replies:
    0
    Views:
    980
  4. Replies:
    1
    Views:
    696
    Damien
    Feb 22, 2007
  5. Max2006
    Replies:
    2
    Views:
    1,567
    Walter Wang [MSFT]
    Sep 19, 2007
Loading...

Share This Page