Jump to content

Can I Nest A Datalist Within A Loginview's Rolegroup?


Recommended Posts

I need to know if you can nest a datalist within a LoginView's RoleGroup. I have two separate datalists, and I want to show one for admin users, and another for dept-specific users using ASP.NET Membership. Here is what I have:

<asp:LoginView ID="LoginView1" runat="server">		<LoggedInTemplate>			Below is a list of jobs:		</LoggedInTemplate>		<RoleGroups>			<asp:RoleGroup Roles="Public Works">				<ContentTemplate>					<!-- DEPT-SPECIFIC DATALIST GOES HERE -->			<asp:DataList ID="dlJobs_depts" runat="server">				<ItemTemplate><asp:Label ID="lblJobTitle" runat="server" /></ItemTemplate>			</asp:DataList>				</ContentTemplate>			</asp:RoleGroup>			<asp:RoleGroup Roles="Power Admin">				<ContentTemplate>					<!-- ADMIN DATALIST GOES HERE -->			<asp:DataList ID="dlJobs_admin" runat="server">				<ItemTemplate><asp:Label ID="lblJobTitle" runat="server" /></ItemTemplate>			</asp:DataList>				</ContentTemplate>			</asp:RoleGroup>		</RoleGroups>	</asp:LoginView>

And this is the resulting error: Compiler Error Message: BC30451: Name 'dlJobs_admin' is not declared.So my questions are: * Is there a way to do this? * If not, what would be an alternative? * If so, what am I doing wrong?Thanks for any and all help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...