all groups > asp.net building controls > october 2005 >
You're in the

asp.net building controls

group:

Adding Windows Security to ascx


Adding Windows Security to ascx Arco
10/24/2005 12:54:48 PM
asp.net building controls:
I have an application that is growing and requires Windows role based
security built into a navagation user control. I currently have the
security in the aspx forms with the Web.config file authorization and
authentication accessing roles and it is working.

I've created a user control, but unlike the aspx forms, the "Users" class
that I employ in the forms (read: User.IsInRole("someRole")) is not
available in the ascx user control. Adding: Imports System.Security still
does not allow me us use the "User" class.

Any ideas on what code I am missing?

Re: Adding Windows Security to ascx Arco
10/24/2005 1:09:49 PM
I get to answer my own question:

Add the Page class prior to the user:

Page.User.IsInRole("whateverRole")


[quoted text, click to view]

AddThis Social Bookmark Button