Click here to Skip to main content
15,888,088 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to redirect a page after login of a specific role user. but i dont get where i can do the changes in code. on login.cs of dnn module i am not geting any of username or password to check wheather the login user role is what. so please help me. if possible show the steps. i am new to dnn........
Posted

1 solution

if(this.UserId>0)
{
C#
DotNetNuke.Entities.Users.UserInfo USERINFO = DotNetNuke.Entities.Users.UserController.GetUserById(PortalId, this.UserId);
                if (!USERINFO.IsInRole("Administrators"))
                {

//do something

}}
else
{
C#
string loginURL = string.Format("{0}://{1}/Default.aspx?ctl=login",
    Request.Url.Scheme, Request.Url.Host);
Response.Redirect(loginURL);

}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900