Home All Groups Group Topic Archive Search About

ASP.Net 2.0 DropDownList Selected Not Working...

Author
22 Sep 2006 7:14 AM
den 2005
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

Author
22 Sep 2006 9:04 AM
ReyN
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
   }
}
Author
25 Sep 2006 2:29 AM
den 2005
Thanks, ReyN..


--
MCP Year 2005, Philippines


Show quoteHide quote
"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
>    }
> }
>
>