简体   繁体   中英

Modal Popup Extender not working from logged in event

After user sucessfully logs in I am trying to ask users which page they want to view.

I have tried this with modal popup extender, but Modal popup extender does not show when I try to call it from loggedin event. Code is listed below. Is there anything wrong with the code?

protected void Login1_LoggedIn(object sender, EventArgs e)
    {

        user_redirection_process();

        switch (validateResult)
        {
            case "M":
                ModalPopupExtender1.Show();

                break;
            case "A":                    
                Response.Redirect("~/Account/A/A.aspx");
                break;
            case "B":
                Response.Redirect("~/Account/B/B.aspx");
                break;
            default:
                //Response.Redirect("~/Account/A/A.aspx");
                break;

        }

    }

I am using membership framework and login control to handle login process.

Front End looks like this:

   <asp:Panel ID="Panel1" runat="server" style ="display:none">
    <a href="Account/A/A.aspx">dkny</a>
    <a href="Account/B/B.aspx">dko</a>

</asp:Panel>
<asp:LinkButton ID="dummy" runat="server" style="display:none">LinkButton</asp:LinkButton>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" DropShadow="True" PopupControlID="Panel1" TargetControlID="dummy"></ajaxToolkit:ModalPopupExtender>

When using Login Control upon successful login, you will be automatically redirected to the DefaultUrl or RedirectUrl supplied by FormsAuthentication.

So I believe, you will have to use regular inputs and button for login and handle the login mechanism accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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