ModalPopupExtender silly problems

 1. To pass information from server to a modal popup may not display if foreground and background color are same.

2. To create a customized modal popup from open source we need to customize carefully. For example.

 

<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none"  >
                <br />
                <asp:Label ID="lblMsg" runat="server" Height="30px" ForeColor="red"></asp:Label>
            <table style="width: 270px">
               
                <tr>
                    <td >
                    </td>
                    <td>
                        &nbsp; &nbsp; &nbsp;
                       

                        <asp:Button ID="btnCancel" runat="server" Text="Cancel"  />
                        <asp:Button ID="btnLogin" runat="server" Text="LogIn"                                    OnClick="btnLogin_Click"
/>                      </td>                      
                </tr>
            </table>
      
    </asp:Panel>

 

 <asp:LinkButton ID="lnkLoginbtn" runat="server" >Login</asp:LinkButton>

<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtenderLogin" runat="server"
             TargetControlID="lnkLoginbtn"
             PopupControlID="Panel1"
             BackgroundCssClass="modalBackground"
             DropShadow="true"
             OkControlID="btnLogin"
             OnOkScript="ok()"
             CancelControlID="btnCancel" />

 

Here is the server side code to call the control

 

            lblMsg.Text = "Here I am";
            userUpdatePanel.Update();
           
ModalPopupExtenderLogin.Show(); 

 

If we delete  btnLogin from aspx file. but if we don't delete from ajaxtoolkit


OkControlID="btnLogin"
             OnOkScript="ok()"

 

it will neither show popup nor show any problem identification message. When we delete the above two lines of code then it works fine.

Comments