簡體   English   中英

在單選按鈕上顯示模式彈出窗口

[英]show modal pop up on radiobutton click

<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>

我想顯示上面檢查過的radiobtn上的模式彈出窗口。 下面是代碼。 IAM沒有得到善意的建議是要完成的工作

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";

可能會對您有幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM