Button click event handler

P

Patrick

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?
 
V

Victor Garcia Aprea [MVP]

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 said:
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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,016
Latest member
TatianaCha

Latest Threads

Top