Hi friends,
I have a login name and a login status control in default.aspx,im using asp.net membership,(not custom)
login name does not show user name and login status also
before and after login, login status shows 'login' text.
here is details:
web.config:
<configuration>
<connectionStrings>
<add name="LoginConnectionString"
connectionString="Data Source=.;Initial Catalog=dblogin;Integrated Security=True" />
</connectionStrings>
<system.web>
<authentication mode="Forms"/>
<membership defaultProvider="MyMembershipProvider">
<providers>
<add name="MyMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
passwordFormat="Clear"
minRequiredPasswordLength="1"
minRequiredNonalphanumericCharacters="0"
requiresQuestionAndAnswer="false"
connectionStringName="LoginConnectionString"/>
</providers>
</membership>
<compilation debug="true" targetFramework="4.0" />
</system.web>
</configuration>
default.aspx:
<asp:LoginName ID="LoginName1" FormatString="welcome {0}" runat="server" />
<asp:LoginStatus ID="LoginStatus1" runat="server" />
default.aspx.cs
protected void LoginStatus1_Logout(object sender, LoginCancelEventArgs e)
{
FormsAuthentication.SignOut();
Response.Redirect("Default.aspx");
}
login.aspx.cs:
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
e.Authenticated = true;
FormsAuthentication.RedirectFromLoginPage(Login1.UserName, false);
}
that's all. what I have to do more?