Try Now
More in this section

Forums / Security / Create User Wizard displays even for logged in users

Create User Wizard displays even for logged in users

3 posts, 0 answered
  1. Nathan J Pledger
    Nathan J Pledger avatar
    27 posts
    21 Apr 2006
    01 Aug 2009
    Link to this post


    We want to create an authentication page for our forums. We have a forum at:

    We'd like a bar along the top to point users to a page for either Creating an Account / Logging in if not logged in, or managing their profile/Logging out if they are logged in.

    So far I am working on the Create Account page (which is not linked from the site currently), which is at:


    But the Wizard appears even when the user is logged in. How can I prevent this, instead displaying the Manage Profile page, instead?
    Great new website, by the way. Particularly with the Showcased sites. This gives me confidence that if big names are using this CMS, then it should be good enough to do anything! Although in Chrome your post editor window displays full height but I am editing in about a 100px high window - not easy!
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    03 Aug 2009
    Link to this post
    Hi Nathan J Pledger,

    Thank you for using our services.

    This is the CreateUserWizardControl's default behavior. In your case you can modify the Page_Load event of the login control or the create user control, and istead of loading the login page, to redirect you to your manage profile page. The overriden Page_Load() should look somthing like this:
    protected void Page_Load(object sender, EventArgs e) 
            if (HttpContext.Current.User.Identity.IsAuthenticated) 
                Response.Redirect("url of your manage profile page"); 

    I hope that this is what you want to achieve. If not please, get back to us and we will try to help you.

    All the best,
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  3. Nathan J Pledger
    Nathan J Pledger avatar
    27 posts
    21 Apr 2006
    06 Sep 2009
    Link to this post
    Thanks for your help, Rado.

    I've created my own control to do this, which is a shame as it should be "in the box", in my opinion.

    For others and Google, this is what I have done:

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="LoginStatus.ascx.cs" 
        Inherits="ProgramX.ClearVision2.ShoppingBasket.ASPNET.WebSite.LoginStatus" %> 
    <%@ Register TagPrefix="CV" TagName="BuyProductLink" Src="~/CVCmsResources/ShoppingBasket/BuyProductLink.ascx" %> 
    <%@ Register TagPrefix="CV" TagName="BasketEditor" Src="~/CVCmsResources/ShoppingBasket/BasketEditor.ascx" %> 
    <div class="loginStatus">         
            <asp:PlaceHolder ID="plhIsLoggedIn" runat="server" Visible="false">  
                    <li><a href="#" id="aProfile" runat="server" title="Access your Profile"></a></li>  
                    <li><a href="#" id="aLogout" runat="server">Logout</a></li>  
            <asp:PlaceHolder ID="plhIsNotLoggedIn" runat="server" Visible="false">  
                    <li><a href="#" id="aLogin" runat="server">Login</a></li>  
                    <li><a href="#" id="aRegister" runat="server">Register</a></li>  
            <li><a href="#" title="About Logging in" id="aWhatsThis" runat="server">What's this?</a></li>  

    using System;  
    using System.Collections;  
    using System.Configuration;  
    using System.Data;  
    using System.Linq;  
    using System.Web;  
    using System.Web.Security;  
    using System.Web.UI;  
    using System.Web.UI.HtmlControls;  
    using System.Web.UI.WebControls;  
    using System.Web.UI.WebControls.WebParts;  
    using System.Xml.Linq;  
    using ProgramX.ClearVision2.ShoppingBasket.AspNet;  
    namespace ProgramX.ClearVision2.ShoppingBasket.ASPNET.WebSite  
        public partial class LoginStatus : System.Web.UI.UserControl  
            #region ~ Properties ~  
            public string ProfileUrl { getset; }  
            public string LogoutUrl { getset; }  
            public string LoginUrl { getset; }  
            public string RegisterUrl { getset; }  
            public string HelpUrl { getset; }
            #region ~ Constructors ~  
            public LoginStatus()  
                ProfileUrl = string.Empty;  
                LogoutUrl = string.Empty;  
                LoginUrl = string.Empty;  
                RegisterUrl = string.Empty;  
                HelpUrl = string.Empty;  
            protected void Page_Load(object sender, EventArgs e)  
                aWhatsThis.HRef = ResolveClientUrl(HelpUrl);  
                if (HttpContext.Current.User.Identity.IsAuthenticated)  
                    plhIsLoggedIn.Visible = true;  
                    plhIsNotLoggedIn.Visible = false;  
                    aProfile.Controls.Add(new LiteralControl(HttpContext.Current.User.Identity.Name));  
                    aProfile.HRef = ResolveClientUrl(ProfileUrl);  
                    aLogout.HRef = ResolveClientUrl(LogoutUrl);  
                    plhIsLoggedIn.Visible = false;  
                    plhIsNotLoggedIn.Visible = true;  
                    aRegister.HRef = ResolveClientUrl(RegisterUrl);  
                    aLogin.HRef = ResolveClientUrl(LoginUrl);  

    This adds some properties which allows you to add the required URLs in, permitting the User to interact with their Profile as they would expect.
Register for webinar
3 posts, 0 answered