469,630 Members | 1,197 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,630 developers. It's quick & easy.

Bind to Roles.GetRolesForUser

Hi,

I have a GridView that I want to bind user roles to

gvUserRoles.DataSource = Roles.GetRolesForUser("Username");
gvUserRoles.DataBind();

How can access the roles using

<asp:GridView ID="gvUserRoles" runat="server"
AutoGenerateColumns="false">
<Columns>
<asp:TemplateField HeaderText="Roles">
<ItemTemplate>
Something like this???? <%#
Eval("RoleName")%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

Thanks
M.

Sep 13 '07 #1
1 2199
On Sep 13, 2:43 am, mazdotnet <maflat...@gmail.comwrote:
Hi,

I have a GridView that I want to bind user roles to

gvUserRoles.DataSource = Roles.GetRolesForUser("Username");
gvUserRoles.DataBind();

How can access the roles using

<asp:GridView ID="gvUserRoles" runat="server"
AutoGenerateColumns="false">
<Columns>
<asp:TemplateField HeaderText="Roles">
<ItemTemplate>
Something like this???? <%#
Eval("RoleName")%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

Thanks
M.
Hi, try <%# Container.DataItem.ToString() %>

http://msdn2.microsoft.com/en-us/library/8h930x07.aspx

Sep 13 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Steven Blair | last post: by
1 post views Thread by Jonathan Woods | last post: by
1 post views Thread by xeroxero | last post: by
4 posts views Thread by AC | last post: by
2 posts views Thread by Jonathan Wood | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.