473,395 Members | 1,688 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.

Problem with Roles.GetUsersInRole

Bob
Hi All:
I have a page where the managers can maintain their own users -
GridView is populated with the list of users. When the manager adds a
new user (button click event calls Roles.AddUserToRole) the subsequent
call to Roles.GetUsersInRole is not returning the user just added. It
is returning a string[], but without the one. Is there a way to force
a refresh of the provider?
-Bob

Aug 11 '06 #1
2 2073
On 11 Aug 2006 09:49:03 -0700, "Bob" <ph******@bellsouth.netwrote:
>Hi All:
I have a page where the managers can maintain their own users -
GridView is populated with the list of users. When the manager adds a
new user (button click event calls Roles.AddUserToRole) the subsequent
call to Roles.GetUsersInRole is not returning the user just added. It
is returning a string[], but without the one. Is there a way to force
a refresh of the provider?
-Bob
Is the subsequent call in the same request?

Where are you calling Roles.GetUsersInRole from? what event?
Peter Kellner
http://peterkellner.net
Aug 11 '06 #2
Bob
Hello Peter:
Thanks for responding. Below is a snippet of my code.

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DropDownListRoles.DataSource = Roles.GetAllRoles();
DropDownListRoles.DataBind();
}
GridView1.DataSourceID = null;
GridView1.DataSource = GetCurrentUsers();
GridView1.DataBind();
}

protected void btnAddUser_Click(object sender, EventArgs e)
{
if(!Roles.IsUserInRole(DropDownListUsers.SelectedV alue,
DropDownListRoles.SelectedValue))
Roles.AddUserToRole(DropDownListUsers.SelectedValu e,
DropDownListRoles.SelectedValue);
}

Aug 14 '06 #3

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

Similar topics

8
by: Filip Dreger | last post by:
Each function has a func_code property that is suposed to contain the pure bytecode of the function. All the context (including reference to relevant namespaces) is stored in different fields of...
2
by: Tjerk Wolterink | last post by:
Hello i've an xpath problem using sablatron in php. In xsl i have the following code: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"...
4
by: Jeff B | last post by:
I am having a very perplexing problem with setting the user's roles. I have tried to figure this out for 2 days now. When the user logs in to the site, I retrieve the roles from the database and...
3
by: tshad | last post by:
I am playing with GenericPrincipal classes and am using a sample program to test it. The problem is that even though I set the roles (which shows the roles in the Context.User as being there),...
2
by: Ron | last post by:
Hi, I need to retrieve only users and there information in the aspnet_Membership table that are associated with certain roles and then populate a GridView with only those users found that belong...
3
by: Steven Nagy | last post by:
Hi all, I'm getting across the membership API stuff. However it seems that we would have benefitted from some extra controls for "Manage Users" and "Manage Roles". Is there some additional...
6
by: Fendi Baba | last post by:
i used the example in the MSDN to getroles and assign users to it on my local development plat form and it worked flawlessly, When I move the same code production, the rolesListbox does not get...
0
by: Chris | last post by:
Hi, i have a problem with sitemap combined with roles. I already posted this but i reformulated simplier: here: there are two defined users: user1 and user2 there is one role: manager user1...
21
by: adjo | last post by:
I am working on an app with an Access2002 frontend and Sql2005 backend. I have to use integrated security. I want to prevent my users from altering data in another way than via the frontend. It...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.