Adding Server Client Event on my <input> tag ASP.NET -
i need trigger event handler on server side through input tag
<div id="ck-button"> <label> <input type="checkbox" runat="server" value="1" onserverchange="input_click" /><span>red</span> </label> </div>
and tried next code capture event, not firing input_click
.
protected void input_click(object sender, eventargs e) { scriptmanager.registerstartupscript(this, gettype(), "alert", "alert('you have clicked button!');", true); }
thanks need help in one.
you need set autopostback=true fire event. html command not asp.net control, can accomplish follows.
<input type="checkbox" runat="server" value="1" onserverchange="input_click" id="chk" onclick="javascript: form1.submit();" /><span>red</span>
i assume have <form id="form1" ...
, if form
has different id, utilize in place of form1
.
asp.net event-handling server-side
No comments:
Post a Comment