Click here to Skip to main content
13,408,530 members (42,291 online)
Click here to Skip to main content

Stats

95.8K views
4.1K downloads
26 bookmarked
Posted 25 Aug 2010

Authenticate User by Roles in ASP.NET

, 25 Aug 2010
A simple forms authentication strategy in ASP.NET with example web site
WebSite
Admin
App_Data
App_Themes
Red
Bin
RoleBasedFormAuthentication.dll
RoleBasedFormAuthentication.dll.refresh
Global.asax
Web.sitemap
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ul>
            <asp:Repeater ID="TopMenuRepeater" runat="server" DataSourceID="SiteMapDataSource">
                <ItemTemplate>
                    <li>
                        <asp:HyperLink runat="server" ID="MenuLink" NavigateUrl='<%# Eval("Url") %>'><em><b><%# Eval("Title") %></b></em></asp:HyperLink>
                    </li>
                </ItemTemplate>
            </asp:Repeater>
        </ul>
    </div>
    </form>
    <asp:SiteMapDataSource ID="SiteMapDataSource" runat="server" ShowStartingNode="False" />
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Lewis Liu L
Software Developer
Australia Australia
No Biography provided

You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.180221.1 | Last Updated 26 Aug 2010
Article Copyright 2010 by Lewis Liu L
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid