Using LoginView Control with Roles - Community Credit Forums
in

    Community Credit Forums

Using LoginView Control with Roles

Last post Mon, Mar 3 2008 8:44 AM by PeteO'Hanlon. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • Thu, Feb 21 2008 8:58 AM

    Using LoginView Control with Roles

    Suppose if we want to display some controls or contents based on the users role then this control is a champion of doing it with very less effort.

    Refer the below code for using it.

    <asp:LoginView ID="loginvew" runat="server">

        <RoleGroups>

        <asp:RoleGroup Roles="2">

        <ContentTemplate>
            <b>Technical Information:</b><%= TechnicalErrorMsg %>
        </ContentTemplate>

        </asp:RoleGroup>

        </RoleGroups>

       </asp:LoginView>

    The content will be visible only for those users with role = 2.

    Thought of sharing this simple tip!

    Happy Coding!!!

    Regards,
    Satheesh
    www.codedigest.com
    www.satheeshbabu.com
    http://satheeshbabu.blogspot.com

  • Thu, Feb 21 2008 1:54 PM In reply to

    Re: Using LoginView Control with Roles

    Nice tip, Satheesh!
    Kindest regards,
      David Silverlight

    Follow me on Twitter: @HeadGeek
  • Mon, Mar 3 2008 8:44 AM In reply to

    Re: Using LoginView Control with Roles

    Very nice. I didn't know you could do that - it just goes to show; there's always something new to learn.
    Deja View - The feeling you've seen this post before.
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems