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
Post a Comment