单选按钮单击时显示模式弹出窗口

本文关键字:窗口 模式 显示 单击 单选按钮 | 更新日期: 2023-09-27 18:33:03

<tr>
    <td align="left">Have you asked the employee to leave without serving the notice period</td>
    <td align="left">
        <asp:RadioButton ID="rdoBtnleaveWoNoticeyes" runat="server" GroupName="Replacement" 
             Text="Yes" Font-Names="Arial" Font-Size="Small" AutoPostBack="true" 
             oncheckedchanged="rdoBtnleaveWoNoticeyes_CheckedChanged" /> &nbsp;
        <asp:RadioButton ID="rdoBtnleaveWoNoticeno" runat="server" GroupName="Replacement" 
             Text="No" Font-Names="Arial" Font-Size="Small"  AutoPostBack="true"
             oncheckedchanged="rdoBtnleaveWoNoticeno_CheckedChanged" />
    </td>
    <td align="left" colspan="2"><%--Remark--%>
    </td>
</tr>
<cc1:ModalPopupExtender ID="cc18_ModalPopupExtender" 
     runat="server" BackgroundCssClass="modalBackground" TargetControlID="rdoBtnleaveWoNoticeyes" PopupControlID="Panel18" CancelControlID="btnwonoticeperiod">
</cc1:ModalPopupExtender>
<asp:Panel ID="Panel18" runat="server" CssClass="modalPopup" Style="display: none;top:50px">
    <table width="90%" border="0" style="border-collapse:collapse;font-family: Arial; font-size: small" cellpadding="2" cellspacing="2">
        <tr><td align="left">
            <asp:Label ID="lbl_leaveWoNotice" runat="server" ></asp:Label>
             </td>
        </tr>
        <tr><td align="center">
            <asp:Button ID="btnwonoticeperiod" runat="server"  Text="Save" OnClick="btnPLAdjSave_Click" CssClass="clsButtonpopup" />&nbsp;
            <asp:Button ID="Button2" runat="server" Text="Cancel" CssClass="clsButtonpopup" />
        </td></tr>
    </table>
</asp:Panel>

我想在上面检查的无线电btn上显示模态弹出窗口是设计。下面是代码。我没有得到输出好苏格萨特笏要完成

protected void rdoBtnleaveWoNoticeyes_CheckedChanged(object sender, EventArgs e)
{
    if (rdoBtnleaveWoNoticeyes.Checked == true)
    {
        lbl_leaveWoNotice.Text = "As you have asked the employee to leave without serving notice, there will be no Notice recovery from employee and employee will receive his PL encashment treating this as “Ask to leave” case.";
        trNoticePayRecovery.Visible = true;
        cc18_ModalPopupExtender.TargetControlID = "rdoBtnleaveWoNoticeyes";
        cc18_ModalPopupExtender.Show();
    }
}
protected void rdoBtnleaveWoNoticeno_CheckedChanged(object sender, EventArgs e)
{
    lbl_leaveWoNotice.Text = "As process there will be Notice period shortfall recovery with PL bal adjustment from employee.";               
    trNoticePayRecovery.Visible = false;
    cc18_ModalPopupExtender.TargetControlID = "rdoBtnleaveWoNoticeno";
    cc18_ModalPopupExtender.Show();
}

单选按钮单击时显示模式弹出窗口

您不会获得所需的输出,因为您将在触发事件后分配 TargetControlID。只需删除这些行:

cc18_ModalPopupExtender.TargetControlID = "rdoBtnleaveWoNoticeno";

cc18_ModalPopupExtender.TargetControlID = "rdoBtnleaveWoNoticeyes";

也许它会帮助你。