Newbie Question

  • Thread starter Thread starter Samuel Shulman
  • Start date Start date
S

Samuel Shulman

Hi

I simply want to redirect some users to the standard 'You are not authorized
to view this page' page manually in the Load event of the page

How can I do that?

Samuel
 
It's very easy, but a lot depends on how you determine the users. With Forms
authentication and roles populated (you can do the same with Membership /
Roles in ASP.NET 2.0) the process would go like this:

//Page_Load:

if(User.IsInRole("crummyOldUser")
Response.Redirect("CrummyOldUserPage.aspx");

Cheers,
Peter
 
Back
Top