Hi,
I would appreciate advise on what is incorrect in the following sample code? The result I get is always that the panel is not visible, even though the authenticated user is a member of 'Domain\ADGroup'.
If I can at least confirm the code 'should' work, that would be a help.
Page.aspx.vb
If HttpContext.Current.User.IsInRole("Domain\ADGroup") Then
Panel1.Visible = True
Label1.Text = "Hello"
Else
Panel1.Visible = False
Label1.Text = "Not working"
End If
Web.config
<connectionStrings>
<add name="ADService" connectionString="LDAP://Domain.internal"/>
<add name="ApplicationServices" connectionString="Data Source=Server;Initial Catalog=ASPNETDB;Persist Security Info="blah blah" providerName="System.Data.SqlClient"/>
</connectionStrings>
<authentication mode="Windows"/>
<identity impersonate="true"/>
<membership defaultProvider="AspNetActiveDirectoryMembershipProvider">
<providers>
<clear/>
<add name="AspNetActiveDirectoryMembershipProvider" enableSearchMethods="true" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ADService" attributeMapUsername="sAMAccountName"/>
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="true">
<providers>
<clear/>
<add name="WindowsProvider" type="System.Web.Security.WindowsTokenRoleProvider"/>
<add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider"/>
<add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider"/>
</providers>
</roleManager>
Many thanks in advance..