有时需要根据客户端的选择结果来确定某些窗体部份显示或关闭.使用jquery可以来打开或关闭.
html
<asp:RadioButtonList runat ="server" ID="dis" >
<asp:ListItem Value="true" Text="显示"></asp:ListItem>
<asp:ListItem Value="false" Text="隐藏"></asp:ListItem>
</asp:RadioButtonList>
jquery方法一:
$(document).ready(function () {
$("#dis").change( function () {
alert($("#dis").find(":checked").val());
});
});
jquery方法二:
$(document).ready(function () {
$("#dis").change( function () {
alert($("input[name='dis']:checked").val());
});
});