Role Enabled Custom Controls
So we did all this work to a membership provider and a role provider for ASP.NET and it was a lesson in patients as we figured out how it was all suppose to work. However, now we have it I found out that the ASP.NET controls are not enabled for roles. It works well with our Forms authentication for blocking access to pages where the user doesn't have the right role. However, I want to display controls and not display controls based on the user's role. I love to create custom controls that work just like we want them to work. So I subclassed the Panel control and "roles" enabled it. Code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebUtility { [DefaultProperty( "Text" )] [ToolboxData( "<{0}:RolePanel runat=server></{0}:RolePanel>" )] public class RolePanel : Panel {