Use the ServerChange event for HTML controls : Introduction « HTML Controls « ASP.NET Tutorial






<%@ Page Language="C#" %>

<script runat="server">
public void DetectChange(object sender, EventArgs e) 
{
    HtmlInputCheckBox cb = (HtmlInputCheckBox) sender;
    Response.Write("Control <b>" + cb.UniqueID + "</b> changed<br>");
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Server changes</title>
</head>
<body>
    <div id="pageContent">
        <form id="Form1" runat="server">
            <input runat="server" type="checkbox" id="one" 
                onserverchange="DetectChange" />One<br />
            <input runat="server" type="checkbox" id="two" 
                onserverchange="DetectChange" />Two<br />
            <input runat="server" type="checkbox" id="three" 
                onserverchange="DetectChange" />Three<br />
            <input runat="server" type="submit" value="Submit" />
        </form>
    </div>
</body>
</html>








4.1.Introduction
4.1.1.Important HTML Control Properties
4.1.2.Which controls provide a ServerClick event and which ones provide a ServerChange event.
4.1.3.Use the ServerChange event for HTML controls