Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > ASP.Net 2.0 DropDownList Selected Not Working...

Reply
Thread Tools

ASP.Net 2.0 DropDownList Selected Not Working...

 
 
den 2005
Guest
Posts: n/a
 
      09-22-2006
Hi everybody,

I populate the dropdownlist control dynamically and when I am about to
get the value of selected item in the dropdownlist I always get the first
one, when I try to set the autopostback to true, no matter what I select in
the dropdownlist it goes back to first selection. Is there anyone knows how I
could solve this? This never happens when I am using asp.net 1.0 and 1.1.

This is very strange...

den2005



--
MCP Year 2005, Philippines
 
Reply With Quote
 
 
 
 
ReyN
Guest
Posts: n/a
 
      09-22-2006
The DropDownList must be populated only on the initial page load, if
not the list will behave just like you pointed out.

void Page_Load ( ) {
if ( ! IsPostBack ) {
// bind dropdownlist here
}
}

 
Reply With Quote
 
 
 
 
den 2005
Guest
Posts: n/a
 
      09-25-2006
Thanks, ReyN..


--
MCP Year 2005, Philippines


"ReyN" wrote:

> The DropDownList must be populated only on the initial page load, if
> not the list will behave just like you pointed out.
>
> void Page_Load ( ) {
> if ( ! IsPostBack ) {
> // bind dropdownlist here
> }
> }
>
>

 
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
Selected ListItem in DropDownList does not appear selected Nathan Sokalski ASP .Net Web Controls 0 10-05-2008 10:29 PM
Selected ListItem in DropDownList does not appear selected Nathan Sokalski ASP .Net 0 10-05-2008 10:29 PM
DropDownList 2 always returns Selected = 0 for all items - even selected item Iain ASP .Net 3 12-11-2006 11:07 AM
DropDownList.FindByValue.Selected not working... help! =?Utf-8?B?ZGhucml2ZXJzaWRl?= ASP .Net 10 01-10-2005 10:04 PM
Compilation Error: dropdownlist does not contain a definition for selected value Ashish Kanoongo ASP .Net 1 02-03-2004 10:41 AM



Advertisments