i have tried a lot of code
using membership of aspnetdb
using login control of login tab
used these all code plz help me
1.
if (Membership.ValidateUser(Login1.UserName, Login1.Password))
{
e.Authenticated = true;
if(Roles.IsUserInRole(Login1.UserName,"ADMIN"))
{
Response.Redirect(@"~/Account/home.aspx");
2.
- protected void LoginUser_OnAuthenticate(object sender, AuthenticateEventArgs e)
- {
- e.Authenticated = false;
- if(Membership.ValidateUser(LoginUser.UserName,LoginUser.Password))
- {
- e.Authenticated=true;
- }
- }
- protected void LoginUser_OnLoggedIn(object sender, EventArgs e)
- 10. {
- 11.
- 12.
- 13. }
- 14.
if (Membership.ValidateUser(Login1.UserName, Login1.Password))
{
e.Authenticated = true;
if(Roles.IsUserInRole(Login1.UserName,"ADMIN"))
{
Response.Redirect(@"~/Account/home.aspx");
3.
if(Membership.ValidateUser(LoginUser.UserName,LoginUser.Password))
{
if(Roles.IsUserInRole("VENDOR"))
{
Response.Redirect("");
}
else if(Roles.IsUserInRole("H.O.D"))
{
Response.Redirect(@"~\h.o.d\hodhome.aspx");
}
but nothing works help me i m terribly stuck here