繁体   English   中英

在asp.net中恢复RadiobuttonList的先前状态

[英]Restore previous state of RadiobuttonList in asp.net

我在asp.net Usercontrol中有一个RadioButtonList。 它包含值“Leave”,“Available”。 当用户点击“离开”时,我应该显示“您确定要离开吗?”的消息。 使用“确定”和“取消”按钮。

当用户单击“可用/离开”时,将触发以下事件。

protected void rdlUser_SelectedIndexChanged(object sender, EventArgs e)
{
    if (rdlUser.SelectedIndex == 0)
    {
            radWindowManager.RadConfirm("Are you sure you want to take Leave?", "confirmSave" + this.ClientID, 300, 100, null, "");
    }
}

这是客户端javascript函数...

function confirmSave<%=this.ClientID%>(arg) {
    if (arg == true) {
        $find('<%= FindControl("txtUser").ClientID %>').set_value("User has taken Leave");
}

**如果用户单击Leave Radiobutton并在确认消息框中单击取消,则程序应将更改还原为“可用”Radiobutton。 如何在服务器/客户端以编程方式选择“可用”?

编辑:主要目标是将值重置为以前的状态**

添加else语句以捕获arg==false并将所需无线电输入的checked属性设置为true 请参阅使用javascript检查单选按钮

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM