|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Membership roles questionHi
I am using the login control with a custom membership provider. My question is; once the user has logged in how do I programmatically check what roles the user belongs to, to provide the user with the relevant features? Thanks Regards John,
Dim AllRoles() As String = System.Web.Security.Roles.GetAllRoles() Dim StringBuilder As New System.Text.StringBuilder For Each Role As String In AllRoles If Me.User.IsInRole(Role) Then StringBuilder.Append(Role & "<br>") End If Next Response.Write(StringBuilder.ToString) -- Show quoteHide quoteSincerely, S. Justin Gengo, MCP Web Developer / Programmer www.aboutfortunate.com "Out of chaos comes order." Nietzsche "John" <John@nospam.infovis.co.uk> wrote in message news:uYPaJp9AGHA.3064@TK2MSFTNGP10.phx.gbl... > Hi > > I am using the login control with a custom membership provider. My > question is; once the user has logged in how do I programmatically check > what roles the user belongs to, to provide the user with the relevant > features? > > Thanks > > Regards > > Page.User.IsInRole("theRoleImTestingFor");
Or use the static methods on the Roles class.
Wizard Control - Referencing buttons in <StepNavigationTemplate>
Datagrid only shows the header Master Page problem Walking thr DataReader Custom memebrship provider problem Sorting in GridView problem User Control First Load Can RDLC Reports be used with Oracle data sources? Cant get a gridview to bind to my dataset Implement form's onSubmit functionality |
|||||||||||||||||||||||