Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DropDownList Control problem

Reply
Thread Tools

DropDownList Control problem

 
 
Mike
Guest
Posts: n/a
 
      08-08-2007
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?U2VyZ2V5IFBvYmVyZXpvdnNraXk=?=
Guest
Posts: n/a
 
      08-08-2007
It looks like you are populating your dropdown in Load event, but do not
check IsPostBack property. Ensure that your dropdown is only populated when
this property is false

"Mike" wrote:

> 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
>

 
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
DropDownList inside GridView: How to set SelectedIndex for the DropDownList? keithb ASP .Net 1 11-01-2006 05:24 AM
GridView: Filter DropDownList for another DropDownList =?Utf-8?B?SnVhbmpv?= ASP .Net 0 12-29-2005 07:44 AM
GridView: Filtr DropDownList from another DropDownList =?Utf-8?B?SnVhbmpv?= ASP .Net 0 12-23-2005 01:31 PM
databinding a Dropdownlist to another dropdownlist tshad ASP .Net 8 10-19-2005 10:00 PM
Using a data-bind dropdownlist to populate another data-bind dropdownlist mr2_93 ASP .Net 1 10-02-2005 05:07 PM



Advertisments