Never Mind it’s working now (have no idea why but that’s ok), and thank you everybody for your help
i have written a code that login users by email instead of username here it is :
protected void eLogin(object sender, EventArgs e) //allowing users to login with email
{
string uid = Membership.GetUserNameByEmail(mainLogin.UserName);
mainLogin.UserName = null;
mainLogin.UserName = uid;
}
and here is the login control:
<asp:Login ID="mainLogin" runat="server" Orientation="Horizontal"
RememberMeText="Remember me" TitleText=""
DestinationPageUrl="~/RedirectPage.aspx"
OnLoggingIn="eLogin"
>
<CheckBoxStyle CssClass="remBox" />
<LoginButtonStyle CssClass="loginButton" />
<TextBoxStyle CssClass="loginTextBox" />
</asp:Login>
but it will only work on localhost and not the actual hosting.
here is what goes wrong :Your login attempt was not successful. Please try again.
i am using asp.net 3.5, thanks in advance
Since you did not post your error, I can only guess that your
Membership.GetUserNameByEmailis failing. Either your connection to a database is failing, or the user does not exist in the database to which you are connecting.