+1-888-365-2779
Try Now
More in this section

Forums / Designing with Sitefinity / Login button in Admin is hardcoded to sitefinity/login.aspx

Login button in Admin is hardcoded to sitefinity/login.aspx

2 posts, 0 answered
  1. MNP
    MNP avatar
    79 posts
    Registered:
    23 Apr 2008
    14 Aug 2009
    Link to this post
    I've successfully created my own login screen, by modifying the web.config to point to our login page as well as when users login into the Sitefinity CMS to redirect to the same login screen

    To do that I followed the directions from this post: http://www.sitefinity.com/support/forums/sitefinity-3-x/developing-with-sitefinity/sitefinity-login-page.aspx

    However, if I click the log out button in the CMS, it redirects back to the Sitefinity/login.aspx page. Looking further inside the Sitefinity/Admin/Admin.master page, it simply does a redirect.

    protected void logoutButton_Click(object sender, System.EventArgs e) 
        { 
            System.Web.Security.FormsAuthentication.SignOut(); 
            //Response.Redirect("~/Sitefinity/Login.aspx"); 
            Response.Redirect(Telerik.Cms.Web.UrlHelper.LoginUrl); 
        } 

    To make this all work, I've modified the Admin.master page to use the LoginURL property (similar to what each individual page does in the CMS)

    Would it be possible to modify your code for next version to use this property instead of just hardcoding login.aspx?

    Thanks

    -Matt
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    14 Aug 2009
    Link to this post
    Hello Matt,

    You could redirect to FormsAuthentication.LoginUrl, so that it will automatically log out you to the LoginUrl you have set in project's web.config.

       protected void logoutButton_Click(object sender, System.EventArgs e) 
        { 
            System.Web.Security.FormsAuthentication.SignOut(); 
            Response.Redirect(FormsAuthentication.LoginUrl); 
        } 

    Best wishes,
    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