View Single Post
  #1 (permalink)  
Old May 21st, 2010, 02:58 PM
Gayathri79 Gayathri79 is offline
Authorized User
 
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
Default How to check if Button is Clicked in ASP?

I have two buttons on the page... How can I find out which Button was clicked, in the Page_Load event?

I tried:
i have placed a label control which has empty Text property.
And when Button is Clicked, I have given some text in the Button_click event.


So when Button is pressed, i thought the page_load check the text property of the label and so detect the Button is Pressed.

But The problem is that when the button is clicked, the page goes to the Page_Load first, before it gets to the click event handlers. so it could not gets its text property.

Is there any way in the page load that I can check to see if the button has been clicked or any way to force the button to run an event handler sub before it runs the page load?