S
Steven Blair
I am writing an application using the ASP.NET Configuration Roles and
Users.
The problem I have, in my C# I need to work out which type of user just
logged in. I am currently using:
string[] role = Roles.GetRolesForUser();
This give me a string "Administrator" etc.
My C# code looks like this:
switch(userType)
{
case "Administrator":
//Do soemthing
//and so on...
}
Has anyone come up with a better way for doing this?
The problems I see with this, if the Role is renamed (would be deleted
and recreated to be called "Admin" for example or a new Role is added.
Any help / advice on this would be appreciated.
Regards,
Steven
Users.
The problem I have, in my C# I need to work out which type of user just
logged in. I am currently using:
string[] role = Roles.GetRolesForUser();
This give me a string "Administrator" etc.
My C# code looks like this:
switch(userType)
{
case "Administrator":
//Do soemthing
//and so on...
}
Has anyone come up with a better way for doing this?
The problems I see with this, if the Role is renamed (would be deleted
and recreated to be called "Admin" for example or a new Role is added.
Any help / advice on this would be appreciated.
Regards,
Steven