Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Bind to Roles.GetRolesForUser

Reply
Thread Tools

Bind to Roles.GetRolesForUser

 
 
mazdotnet
Guest
Posts: n/a
 
      09-13-2007
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.

 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      09-13-2007
On Sep 13, 2:43 am, mazdotnet <(E-Mail Removed)> wrote:
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
confused by boost::bind & boost::lambda::bind XHengDF@gmail.com C++ 0 05-29-2007 04:37 AM
Using a data-bind dropdownlist to populate another data-bind dropdownlist mr2_93 ASP .Net 1 10-02-2005 05:07 PM
Cannot bind to tcp/ip =?Utf-8?B?Um9zbWFuIENvbXB1dGluZw==?= Wireless Networking 1 09-23-2005 11:31 AM
Bind optional one-to-one relationship to textbox Dan Davenport via .NET 247 ASP .Net 0 08-04-2004 01:55 PM
How to bind data from XQuery to a Dataset ?? HNguyen ASP .Net 0 06-03-2004 07:32 PM



Advertisments