Author: Oliphant | Posted on: 11/11/2010 6:30:16 PM | Views : 958

After a recent posting about sending users to different pages based on their roles, I tried to insert the code suggested. The goal is simple: send users to the /User/Directory.html page; send administrators to the /admin/admin.aspx page.  What I get is the following error: "The name 'Roles' does not exist in the current context" with the following line highlighted: string[] allroles = Roles.GetRolesForUser(Login1.UserName);
 
Here is the pertinent code from login.aspx:
<asp:login ID = "Login1"
runat="server"
onloggedin="Login1_LoggedIn"
DestinationPageUrl = "~/User/Directory.html"
</asp:login>
 
Here is the pertinent code from login.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 

Go to the complete details ...