Hello,
I am finally being able to access the login for both accounts AD and ACAD. In order for me to do the login successfully, I have to convert the login page to the “layout template”.
So now, I have another problem is after I login, but I do not see any username on my master page and the logout button.
Can you review my code and see what I am missing? Or can you help me to fix the code? Many thanks.
Here is my master page code.
<div class="sitecontainer">
<div id="MainNavWrapper">
<asp:HyperLink ID="HyperLink1" NavigateUrl="../Faculty.pdf" Text="User's Guide" runat="server" target="_blank" Visible ="false"></asp:HyperLink>
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
|
Logged in as: <asp:LoginName ID="LoginName1" runat="server" />
|
<asp:Label ID="DividerLabel4" runat="server" Visible="False"> | </asp:Label>
<asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="RedirectToLoginPage" />
|
</LoggedInTemplate>
</asp:LoginView>
</div>
</div>
Here is my login page layout template code.
<asp:Login ID="Login1" runat="server" DisplayRememberMe="true" Height="162px" Width="377px">
<LayoutTemplate>
<table cellpadding="1" cellspacing="0" style="border-collapse:collapse;">
<tr>
<td>
<table cellpadding="0" style="height:162px;width:377px;">
<tr>
<td align="center" colspan="2">Log In</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label>
</td>
<td>
<asp:TextBox ID="UserName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
</td>
<td>
<asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2" style="color:Red;">
<asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<asp:Button ID="LoginButton" runat="server" CommandName="Login" OnClick="LoginButton_Click" Text="Log In" ValidationGroup="Login1" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</LayoutTemplate>
</asp:Login>
i do using the form authentification. here is the code from the web.config.
<authentication mode="Forms">
<forms loginUrl="~/Default.aspx" defaultUrl ="~/Default.aspx" timeout="2880" name=".ASPXAUTH" />
</authentication>