Sorry if my title's question is not clear. The thing is in my asp.net application I config web.config of folder "Admin" like this:
<configuration>
<system.web>
<authorization>
<allow roles="Admin" />
<deny users="*"/>
</authorization>
</system.web>
</configuration>
My database has an table "Account" with 3 fields (Username, password, role). Then I use the login control to login the site of folder "Admin" using code:
protected void Login_Authenticate(object sender, AuthenticateEventArgs e)
{
if(checkUser(Login.Username, Login.Password))
e.Authenticated = true;
}
private bool checkUser(string username, string pass)
{
// Check username and pass against database....
}
The problem here is that I do not know how to tell the web.config file that the user has "Admin" role. I can fix this problem by using aspnet_regsql which automatically generates several tables in my database, then I log in successfully using Membership.ValidateUser. However, I do not know what happens underground using these built-in database and features. That's why I wonder if it can be solved using custom database above. Thanks in advance.