|
protected void Page_Load (object sender, EventArgs e)
{
RolePrincipal p = (RolePrincipal) User;
string [] roles = p.GetRoles ();
foreach (string s in roles)
{
Response.Write (s + "<br>");
}
if (HttpContext.Current.User.IsInRole ("PurchaseAdmin"))
{
string url;
url = "~ / Default1.aspx";
Response.Redirect (this.ResolveUrl (url));
}
}
The following error occurred during operation, I seem to have solved it before, but the problem cannot be solved after reinstalling the operating system. ?????
The error is as follows:
Objects of type "System.Security.Principal.WindowsPrincipal" cannot be cast to type "System.Web.Security.RolePrincipal". |
|