c# - How to get server element id on click event in asp.net? -


i have server elements:

<custom:menuitem id="buttonadd" onclick="button_click" runat="server"/> <custom:menuitem id="buttondelete" onclick="button_click" runat="server"/> 

i created method "click" event:

protected void button_click(object sender, eventargs eventargs) {    /*solution of problem*/ } 

i want element id clicked in method.

protected void button_click(object sender, eventargs eventargs) {    var menuitem = sender menuitem;    if(menuitem!=null)    {     var prop = menuitem./*any property want here*/    } } 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -