Allow Roles does not work
<p>I have a web application with 2 folders. Administrator and Trainer which contain their respective pages. I have a web.config in each folder as below. When i login using these configuration settings, the user is denied access to his home page and if I remove deny users everybody can login. I have created roles and added user to the roles using WSAT.  </p>

<p><em><strong>Web.Config For Administrator</em></strong></p>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;configuration&gt;
&lt;system.web&gt;
    &lt;authorization&gt;
      &lt;allow roles="Administrator" /&gt;
      &lt;deny users="?"/&gt;
    &lt;/authorization&gt;
&lt;/system.web&gt;
&lt;/configuration&gt;
</code></pre>

<p><em><strong>Web.Config For Trainer</em></strong></p>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;configuration&gt;
&lt;system.web&gt;
    &lt;authorization&gt;
      &lt;allow roles="Trainer" /&gt;
      &lt;deny users="?"/&gt;
    &lt;/authorization&gt;
&lt;/system.web&gt;
&lt;/configuration&gt;
</code></pre>

<p><strong>Root Folder Web.Config File</strong></p>

<pre><code>&lt;?xml version="1.0"?&gt;

&lt;configuration&gt;
&lt;connectionStrings&gt;
&lt;add name="TSS" connectionString="Data Source = VC-SQL2008; Integrated
    Security=True;   database = aspnetdb" providerName="System.Data.SqlClient"/&gt;
&lt;/connectionStrings&gt;

&lt;system.web&gt;
&lt;compilation debug="true" targetFramework="4.0"/&gt;
&lt;authentication mode="Forms"&gt;
  &lt;forms loginUrl="Login.aspx" timeout="2880" /&gt;
&lt;/authentication&gt;
&lt;/system.web&gt;

&lt;system.web&gt;
&lt;membership&gt;
  &lt;providers&gt;
    &lt;clear/&gt;
    &lt;add name="AspNetSqlMembershipProvider"
 type="System.Web.Security.SqlMembershipProvider" connectionStringName="TSS"
 requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
 enablePasswordRetrieval="false" enablePasswordReset="false"
 maxInvalidPasswordAttempts="5" minRequiredPasswordLength="1"
 minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
 applicationName="/"/&gt;

  &lt;/providers&gt;
  &lt;/membership&gt;

  &lt;profile&gt;
  &lt;providers&gt;
    &lt;clear/&gt;
    &lt;add name="AspNetSqlProfileProvider"
  type="System.Web.Profile.SqlProfileProvider"
   connectionStringName="TSS" applicationName="/"/&gt;
  &lt;/providers&gt;
 &lt;/profile&gt;

 &lt;roleManager enabled="true"&gt;
  &lt;providers&gt;
    &lt;clear /&gt;
    &lt;add connectionStringName="TSS" applicationName="/" name="AspNetSqlRoleProvider"
   type="System.Web.Security.SqlRoleProvider" /&gt;
    &lt;!--&lt;add applicationName="/" name="AspNetWindowsTokenRoleProvider"
      type="System.Web.Security.WindowsTokenRoleProvider" /&gt;--&gt;
  &lt;/providers&gt;
&lt;/roleManager&gt;

&lt;pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/&gt;
&lt;/system.web&gt;

&lt;system.webServer&gt;
&lt;modules runAllManagedModulesForAllRequests="true"/&gt;
&lt;/system.webServer&gt;
&lt;/configuration&gt;
</code></pre>

<p><em><strong>web.sitemap example on how I have added roles</em></strong></p>

<pre><code>enter&lt;siteMapNode url="Administrator/Admin_Home.aspx" title="Home"  description=""
roles="Administrator"&gt; 
</code></pre>

<p><em><strong>Login.aspx.cs</em></strong>
    namespace TSS
    {
        public partial class Login2 : System.Web.UI.Page
        {
              protected void Page_Load(object sender, EventArgs e)
               {
                   dbConnection dbConn = new dbConnection();
               }</p>

<pre><code>  protected void submit_Click(object sender, EventArgs e)
  {
       // var a = Session["username"];
       string password = tb_password.Text;
       // Membership.CreateUser("s.g@visiblechanges.com", "9000");

       bool x = Membership.ValidateUser(tb_email.Text, password);
       string f_name;
       string l_name;
       string trainer="";
       DataTable dt = new DataTable();
       dt = TSS_WebService.getEmployeeByEmail(tb_email.Text);

       foreach (DataRow row in dt.Rows)
       {
            f_name = row["First_Name"].ToString();
            l_name = row["Last_Name"].ToString();
             trainer = row["First_Name"].ToString() + " " +   
           row["Last_Name"].ToString();
       }

   if (x == true)
  {

    Session["username"] = tb_email.Text;
    Session["trainer"] = trainer;

    if (Roles.IsUserInRole(tb_email.Text, "Administrator"))
    {
         Response.Redirect("~/Administrator/Admin_Home.aspx");
    }

  if (Roles.IsUserInRole(tb_email.Text, "Trainer"))
  {

   Response.Redirect("~/Trainer/Trainer_Home.aspx");
  }

   if (Roles.IsUserInRole(tb_email.Text, "Salon Manager"))
   {

    Response.Redirect("~/Salon/Salon_Home.aspx");
   }

   if (Roles.IsUserInRole(tb_email.Text, "IT"))
    {

     Response.Redirect("Home.aspx");
     }
   }

   else
   {
        FormsAuthentication.RedirectToLoginPage();
   }
  }

  }
  }


***Login.aspx***
    &lt;%@ Page Title="" Language="C#" MasterPageFile="~/Master/Master.Master"     
    AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="TSS.Login2" %&gt;
    &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt;
    &lt;/asp:Content&gt;
    &lt;asp:Content ID="Content2" ContentPlaceHolderID="BreadCrumbs" runat="server"&gt;
    &lt;asp:SiteMapPath ID="SiteMapPath1" runat="server"&gt;
    &lt;/asp:SiteMapPath&gt;
    &lt;/asp:Content&gt;
    &lt;asp:Content ID="Content3" ContentPlaceHolderID="MainArea" runat="server"&gt;
    &lt;div id = "loginBox"&gt;
    &lt;h2&gt; LOGIN&lt;/h2&gt;
    &lt;asp:TextBox ID="tb_email" runat="server" class = "ipBox_large"&gt;&lt;/asp:TextBox&gt;&lt;br 
    /&gt;
    &lt;asp:TextBox ID="tb_password" runat="server" class = "ipBox_large"&gt;&lt;/asp:TextBox&gt;  
     &lt;br /&gt;   
     &lt;asp:ImageButton ID= "btn" ImageUrl = "../Images/btnLogin.gif" OnClick = 
     "submit_Click"  
     runat="server" /&gt;
     &lt;asp:CheckBox id="NotPublicCheckBox" runat="server" /&gt; 
     &lt;/div&gt;
    &lt;/asp:Content&gt;
</code></pre>

<p>I've been stuck with this for 2 days now and have researched everything I possibly could.Any help or advice is much appreciated thanks.</p>
