Domanda

I have a users table in my sql server 2008 which has
username, password, email,first name, last name and user group.

I want to display my website controls specific to that user groups once the user logs in.

Could you please help in this issue.

È stato utile?

Soluzione

You can assign user's user group is a session variable at the time of log in. Now you can set (may be on page_load) your pages's controls visibility upon that value.

Something like this,

If(Session["UserGroup"] == "1")
{
    ControlID.Visible = true;
}
else
{
    ControlID.Visible = false;
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top