Roles managemant and sellect from DropDownList problem

M

Mike

Hi
I am using predefined membership and roles managemant approach
characteristic for framework 2.0

Basic idea is that we select some value from DropDownList which
represents a role and we get all users for selected role.
This works and that is not a problem.

Problem is in DropDownList control...

I am using select value as follow:
string roles = DropDownList_Roles.SelectedValue;

Recieived items
---------------------------------------------------------------------------
DropDownList_Roles.DataSource = Roles.GetAllRoles();
DropDownList_Roles.DataBind();

For e.g. if I get following vales:
ABC
AAA
CCC
RRR
FFF

What is wrong?
-----------------------------
Whatever I select, I always getting first value, in this case value
ABC.

Thanks for help.

Mike
 
G

Guest

Hi
I am using predefined membership and roles managemant approach
characteristic for framework 2.0

Basic idea is that we select some value from DropDownList which
represents a role and we get all users for selected role.
This works and that is not a problem.

Problem is in DropDownList control...

I am using select value as follow:
string roles = DropDownList_Roles.SelectedValue;

Recieived items
---------------------------------------------------------------------------
DropDownList_Roles.DataSource = Roles.GetAllRoles();
DropDownList_Roles.DataBind();

For e.g. if I get following vales:
ABC
AAA
CCC
RRR
FFF

What is wrong?
-----------------------------
Whatever I select, I always getting first value, in this case value
ABC.

Thanks for help.

Mike

Hi Mike

I guess it's a simple problem that is not related to security. You
have to select the item which has to be default

For example:

DropDownList_Roles.Items.FindByValue("CCC").Selected = true;

Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top