i need help from u guys here. So, on my system, there are 2 roles. Admin and users. I use login control to enable them to login to the system. How can i make these two roles redirect to different page? I am using membership and form authentication. I would appreciate if you could give some help to me. Thank you :)
Handle the Login controls "OnLoggedIn" event. In this event, determine the current users role. That can be done as follows ("LoginUser" below represents your login control):
string[] userRole = Roles.GetRolesForUser(LoginUser.UserName);
http://msdn.microsoft.com/en-us/library/system.web.security.roleprincipal.getroles%28v=vs.100%29.aspx
Then use Response.Redirect based on the role to send them to the correct destination.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With