Click here to Skip to main content
15,882,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I placed a Loginstatus control on masterpage and using Add Extender, added ModalPopupExtender. Placed a Login control inside this ModalPopup. Turned this Login control to template.

The login control is working if correct ID/Pass is given. But the literal control that is supposed to show FailureText is not showing in updatepanel's no flicker behaviour.

What I have tried:

If I use asp:postbacktrigger it postback full page and again clicking Loginstatus shows the ModalPopup and the FailureText.

If I use asp:AnsyncPostBackTrigger, no postback behavior is shown.

ASP.NET
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Frontend.master.cs" Inherits="sitetitle.MasterPages.mastername" %>

<%@ Register Src="~/Controls/LoginControl.ascx" TagPrefix="uc1" TagName="LoginControl" %>
<%@ Register Src="~/Management/ManagementControls/LoginModalControl.ascx" TagPrefix="uc1" TagName="LoginModalControl" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>

<%//@ Register Src="~/Controls/topLoginUserStrip.ascx" TagPrefix="uc1" TagName="topLoginUserStrip" %>




<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head  runat="server">
    <title>site title</title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    
    <link href="../Styles/styles.css" rel="stylesheet" />
    <script src="../Scripts/modernizr-2.8.3.js"></script>
    
    <link href="../Styles/button.css" rel="stylesheet" />    
    <link href="../Styles/dd.css" rel="stylesheet" />
    <link href="../Styles/dialog.css" rel="stylesheet" />    
    <link href="../Styles/jquery-ui.css" rel="stylesheet" />        
    
    <script src="../Scripts/jquery-2.2.1.js"></script>    
    <script src="../Scripts/jquery-ui-1.11.4.js"></script>    
    <script src="../Scripts/jquery-ui.js"></script>    
    <script src="../Scripts/modernizr-2.8.3.js"></script>

</head>
<body id="body">

    <form id="form1"  runat="server">

        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true" AsyncPostBackTimeout="10000">
            <Scripts>
                <asp:ScriptReference Path="~/Scripts/jquery-2.1.4.min.js" />
            </Scripts>
                    

    <div>
            <asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
            <contenttemplate>
                <asp:Panel runat="server" ID="Pan1" style="display:none;" CssClass="modalPopup" >
                    <asp:UpdatePanel runat="server">
                        <contenttemplate>
                <asp:Login ID="Login1" runat="server" CreateUserText="SignUp" CreateUserUrl="~/Signup.aspx" FailureText="Wrong ID/Password" OnLoggingIn="Login1_LoggingIn" OnLoginError="Login1_LoginError">
                    <layouttemplate>
                        <table cellspacing="0" cellpadding="1" style="border-collapse: collapse;">
                            <tr>
                                <td>
                                    <table cellpadding="0">
                                        <tr>
                                            <td align="center" colspan="2">Log In</td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                <asp:Label runat="server" AssociatedControlID="UserName" ID="UserNameLabel">User Name:</td>
                                            <td>
                                                <asp:TextBox runat="server" ID="UserName">
                                                <asp:RequiredFieldValidator runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ValidationGroup="ctl00$Login1" ToolTip="User Name is required." ID="UserNameRequired">*
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                <asp:Label runat="server" AssociatedControlID="Password" ID="PasswordLabel">Password:</td>
                                            <td>
                                                <asp:TextBox runat="server" TextMode="Password" ID="Password">
                                                <asp:RequiredFieldValidator runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ValidationGroup="ctl00$Login1" ToolTip="Password is required." ID="PasswordRequired">*
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <asp:CheckBox runat="server" Text="Remember me next time." ID="RememberMe">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="2" style="color: Red;">
                                                <asp:Label ID="lblTrial" runat="server" />
                                                <asp:Literal runat="server" ID="FailureText" EnableViewState="False" >
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" colspan="2">
                                                
                                                <asp:Button runat="server" CommandName="Login" Text="Log In" ValidationGroup="ctl00$Login1" ID="LoginButton" OnClick="LoginButton_Click">
                                                
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                Not a member yet? <asp:HyperLink runat="server" NavigateUrl="~/Signup.aspx" ID="CreateUserLink">SignUp
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </layouttemplate>
                
                            </contenttemplate>
                        <triggers>
                                                        <asp:AsyncPostBackTrigger ControlID="Login1" />
                                                    </triggers>  
                    
                            
                </contenttemplate>    
        
    
        

        <asp:LoginStatus ID="LoginStatus1" runat="server" />
        
        <ajaxToolkit:ModalPopupExtender ID="LoginStatus1_ModalPopupExtender"  runat="server" BehaviorID="LoginStatus1_ModalPopupExtender" TargetControlID="LoginStatus1" PopupControlID="Pan1">
        
        
        <div class="site-title"></div>
        <div id="loginModalUserControl" style="display:none;">
            <uc1:LoginControl  runat="server" id="LoginControl" />
        </div>
        <nav>

        </nav>
        
        <asp:ContentPlaceHolder ID="FirstContent" runat="server">
                        
        
        
        <footer>© 2015 - site title</footer>
    </div>
    </form>
</body>
</html>
Posted
Updated 21-May-16 23:33pm
v7

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900