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.

有帮助吗?

解决方案

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;
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top