HTML:
<asp:RadioButtonList ID="rdStatus" runat="server" Height="48px"
RepeatDirection="Horizontal" AutoPostBack="true"
OnSelectedIndexChanged="rdStatus_SelectedIndexChanged" CssClass="rad">
<asp:ListItem Text="Active" Value="1"></asp:ListItem>
<asp:ListItem Text="Deactive" Value="0"></asp:ListItem>
</asp:RadioButtonList>
JQuery的:
$(".rad").click(function () {
return confirm("Do you really want to change status?");
});
无论是否在确认框中单击“确定”或“取消”,它都会导致回发。
答案 0 :(得分:-1)
if (!confirm('Do you really want to change status?')){
return false;enter code here
}
else{
return true;
}
答案 1 :(得分:-1)
<script type="text/javascript">
$(document).ready(function () {
$(".rad").click(function () {
var a = confirm('Do you really want to change status?');
if (a==false) {
return false;
}
else {
return true;
}
});
});
</script>
&#13;