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.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...