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
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 |
Answer / thiyagu
In page Load
Page.Request.Form.Keys
will get which button is clicked
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / guest
you can get the button name with request.forms collection
in the page load.
Is This Answer Correct ? | 3 Yes | 2 No |
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 |
Answer / rathore kuldeep
Request.Form("bsubmit")="name of button"
Is This Answer Correct ? | 0 Yes | 0 No |
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 |
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 |
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 |
What is asp.net web application?
Define managed code and managed data in .net?
Why mvc is faster than asp.net? : Asp.Net MVC
Difference between abstract class and interface
whats the best method to cal id in javascript
Life cycle of ASP.NET page when a request is made ?
What is redirectpermanent in asp.net?
Difference between windows application and web application? Which is the best for updation purpose?
Tell me what is the request flow used for asp.net mvc framework? : asp.net mvc
What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?
What is a master page and what does it do?
What is the life cycle of web page?