Button Problems with Page_Load

T

tatemononai

How do you check to see what button was pressed inside the Page_Load
function?

I've got some code in the Page_Load function that needs to run whenever
a button IS NOT pressed on the web form. But when a button is pressed,
it goes through the Page_Load function, which executes code that blows
away all the code that runs with the button event.

Any suggestions? I've tried checking to see if the button shows up in
the Request.Form[], but it doesn't. The event fires though, so there
has got to be some way to check for the event.
 
G

Guest

Why dont you write the code in Page_PreRender() event which fires after the
button is clicked, so that when the button is cliecked you probably can set a
value in ViewState or Session specifying which button was pressed?
 

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

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,279
Latest member
LaRoseDermaBottle

Latest Threads

Top