Try Now
More in this section

Forums / Developing with Sitefinity / How to redirect user ?

How to redirect user ?

2 posts, 0 answered
  1. rent
    rent avatar
    104 posts
    05 May 2008
    16 Mar 2009
    Link to this post

    How to redirect user, for example, which in role Publishers to other page ~/Publishers/Publishers.aspx. I try add this code in ~\Sitefinity\Login.aspx.cs :

     void Login1_LoggedIn(object sender, EventArgs e)



    if (UserManager.Default.IsUserInRole(this.Login1.UserName,"Publishers"))
    this.Page.Response.Redirect("~/Publishers/Publishers.aspx", true);


    this.Page.Response.Redirect(redirectUrl, true);


    But it does not work. What I did wrong?

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    16 Mar 2009
    Link to this post
    Hi rent,

    Give a try to the sample below:

    string loggedInUser = ((TextBox) Login1.FindControl("UserName")).Text; 
    UserManager man = new UserManager(); 
    string ad = "administrators"
    if(man.IsUserInRole(loggedInUser, ad)) 

    I hope this helps.

    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered