I hve created asp.net web application,in which I want to hide panel in a page for some specific users. only admin can see the panel. I have created admin and other user.after logging, for admin the panel is not showing.
Panel1.Visible = (User.Identity.Name == "admin");
pls help
Riddhi ValechaPosted Dec 30, 2014, 1:53 AM
When user signs in, take the values from database into session variable.
Eg -
Datatable table = new Datatable;
Session["UserDetails"] = table;
------
Here,
from table, check whether the user is admin or not.
If admin, make panel.visible = false;
Else, panel.visible = true;