Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

How to Direct Users to specific Page By roles?

$
0
0

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.

  1. protected void LoginUser_OnAuthenticate(object sender, AuthenticateEventArgs e)
  2.         {
  3.             e.Authenticated = false;
  4.             if(Membership.ValidateUser(LoginUser.UserName,LoginUser.Password))
  5.             {
  6.             e.Authenticated=true;
  7.             }
  8.         }
  9. protected void LoginUser_OnLoggedIn(object sender, EventArgs e)
  10. 10.         {
  11. 11.            
  12. 12.             
  13. 13.         }

 

 

 

 

  1. 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


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>