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

Forums / Designing with Sitefinity / Using the LoginView

Using the LoginView

2 posts, 0 answered
  1. OfficialCommunity
    OfficialCommunity avatar
    8 posts
    Registered:
    11 May 2006
    15 Jan 2008
    Link to this post
    I want to put two generic content sections in, one that shows to authenticated users, the other to anonymous users.  When I drag the LoginView onto the page there doesn't appear to be any way to edit the templates.  What is the recommended way of approaching this scenario?

    Thanks,
    Colin
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    16 Jan 2008
    Link to this post
    Hi Colin,

    In fact, Sitefinity LoginView control is a wrapper of ASP.NET LoginView control and provides a simple implementation of the common scenario for displaying currently logged user and a Logout link. So, to achieve the required functionality, you need to create your own User Control, that wraps the ASP.NET LoginView and set the content for the anonymous and logged users in the corresponding template. For example:

    <asp:LoginView ID="LoginView1" runat="server"
        <LoggedInTemplate> 
            <p> 
                You are logged in user! 
            </p> 
        </LoggedInTemplate> 
        <AnonymousTemplate> 
            <p> 
                You are anonymous user! 
            </p> 
        </AnonymousTemplate> 
    </asp:LoginView> 

    Hope this helps.

    Best wishes,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered