DropDownList客户端添onchange事件

DropDownList客户端加onchange事件在后台绑定之前添加一个属性空间ID.Attributes.Add(onchange,js函数

DropDownList客户端加onchange事件

在后台绑定之前添加一个属性

空间ID.Attributes.Add("onchange","js函数");

如:ddlSubject.Attributes.Add("onchange","IsShow()");

前台:

<script type="text/javascript">
        function IsShow()
        {
          

        }

</script>

 

<asp:DropDownList ID="ddlSubject"  runat="server"  >
</asp:DropDownList>