You have two buttons in web form and i clicked on one of
the button, so how do i find which button i've clicked on
the form in my page load?

Answers were Sorted based on User's Feedback



You have two buttons in web form and i clicked on one of the button, so how do i find which button..

Answer / vijaykumar

Just write code on page load

Response.Write(Request.Form[1].ToString());

u got button name which one u clicked.

Is This Answer Correct ?    5 Yes 2 No

You have two buttons in web form and i clicked on one of the button, so how do i find which button..

Answer / thiyagu

In page Load
Page.Request.Form.Keys
will get which button is clicked

Is This Answer Correct ?    2 Yes 0 No

You have two buttons in web form and i clicked on one of the button, so how do i find which button..

Answer / guest

you can get the button name with request.forms collection
in the page load.

Is This Answer Correct ?    3 Yes 2 No

You have two buttons in web form and i clicked on one of the button, so how do i find which button..

Answer / gaurav joshi,mohit jethva

i have two button btnadd and btnupdate
If (Array.IndexOf(Request.Form.AllKeys, btnadd.ClientID))
{
}

Is This Answer Correct ?    0 Yes 0 No

You have two buttons in web form and i clicked on one of the button, so how do i find which button..

Answer / rathore kuldeep

Request.Form("bsubmit")="name of button"

Is This Answer Correct ?    0 Yes 0 No

You have two buttons in web form and i clicked on one of the button, so how do i find which button..

Answer / richard des jardins

I'm not real sure where you are trying to get this
information. Lets say you have two buttons whose
OnClick="MyButtonClick". The void MyButtonClick(Object
sender,EventArgs e) exposes the Button Object with the
sender reference. Cast the sender to a button and do what
ever you want with it.

Is This Answer Correct ?    0 Yes 0 No

You have two buttons in web form and i clicked on one of the button, so how do i find which button..

Answer / sandhya

Useing commandName property we can find out.

Is This Answer Correct ?    0 Yes 1 No

You have two buttons in web form and i clicked on one of the button, so how do i find which button..

Answer / nithya_raghu

the above code was returning the hidden field value. which
will be non readble format.please make sure before entering
the answer will it work or not.

Is This Answer Correct ?    0 Yes 1 No

You have two buttons in web form and i clicked on one of the button, so how do i find which button..

Answer / bose

due to the question i have one doubt?
The click event is done while i creating the web
application time or after the deployment?

Is This Answer Correct ?    0 Yes 2 No

You have two buttons in web form and i clicked on one of the button, so how do i find which button..

Answer / jaspaul

do a Response.write(sender.toString()) inside each of the
click event methods

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More ASP.NET Interview Questions

What can you do with asp.net?

0 Answers  


How to create a db connection at one place/page so that we can use that connection for all pages/forms/windows.what r the steps ned to be performed if question not clear,let me know

0 Answers  


Explain the difference between authentication and authorization.

0 Answers  


Explain what is the procedure to create the environment for asp.net? : asp.net mvc

0 Answers  


What is state management react?

0 Answers  






how many select state ments are used in stored procedure?

8 Answers   CSC,


how can i insert array values and retreive in asp.net

3 Answers   TCS, Value Labs,


What is session object? Describe in detail.

0 Answers  


How we can force all the validation controls to run?

0 Answers  


Is it possible to develop a single web application using ASP.NET webforms and ASP.MVC?

0 Answers  


Explain what is an assembly?

0 Answers  


Difference between datagrid and datareader?

1 Answers  


Categories