473,395 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Binding 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 1656
Have <%# Container.DataItem %>

"mazdotnet" 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.

Sep 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steven Blair | last post by:
I am writing an application using the ASP.NET Configuration Roles and Users. The problem I have, in my C# I need to work out which type of user just logged in. I am currently using: string...
7
by: Ben R. | last post by:
Hi, The documentation for RoleProvider.IsUserInRole states: "The IsUserInRole method is called by the IsUserInRole method of the Roles class and the IsInRole method of the RolePrincipal class...
2
by: Jules | last post by:
When creating this website I user a custom authentication method to validate the usercredentials (I think the membership provider is an overkill since I only use the authentication part). When I...
1
by: xeroxero | last post by:
What is the fastest way to enumerate roles for an ASP.NET 2.0 user? Authentication and authorization has occurred, and roles have been assigned to my (Generic)Principal. I just want to list them to...
4
by: AC | last post by:
Hi there. My asp.net 2.0 development website uses roles to control access to sections of my site, configured using the asp.net configuration tool, which is great. Except that isn't available once...
1
by: mazdotnet | last post by:
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...
2
by: Jonathan Wood | last post by:
I've set up ASP.NET membership. I can get the role(s) of the current user by calling Roles.GetRolesForUser(). It seems like it would be a good idea to store some role-specific calculations in...
2
by: Nathan Sokalski | last post by:
When I call System.Web.Security.Roles.GetRolesForUser() it returns no results even though I have roles associated with the currently logged in user. I am able to get the username by calling...
2
by: Nathan Sokalski | last post by:
When I call System.Web.Security.Roles.GetRolesForUser() it returns no results (an array of length 0) even though I have roles associated with the currently logged in user. I am able to get the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.