ASP.Net 2.0 DropDownList Selected Not Working...

Discussion in 'ASP .Net Web Controls' started by den 2005, Sep 22, 2006.

  1. den 2005

    den 2005 Guest

    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
     
    den 2005, Sep 22, 2006
    #1
    1. Advertising

  2. den 2005

    ReyN Guest

    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
    }
    }
     
    ReyN, Sep 22, 2006
    #2
    1. Advertising

  3. den 2005

    den 2005 Guest

    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
    > }
    > }
    >
    >
     
    den 2005, Sep 25, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pTsy
    Replies:
    1
    Views:
    457
    Shiva
    Nov 17, 2004
  2. =?Utf-8?B?ZGhucml2ZXJzaWRl?=

    DropDownList.FindByValue.Selected not working... help!

    =?Utf-8?B?ZGhucml2ZXJzaWRl?=, Jan 10, 2005, in forum: ASP .Net
    Replies:
    10
    Views:
    10,817
    Eliyahu Goldin
    Jan 10, 2005
  3. Iain
    Replies:
    3
    Views:
    938
  4. Nathan Sokalski
    Replies:
    0
    Views:
    613
    Nathan Sokalski
    Oct 5, 2008
  5. Nathan Sokalski

    Selected ListItem in DropDownList does not appear selected

    Nathan Sokalski, Oct 5, 2008, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    293
    Nathan Sokalski
    Oct 5, 2008
Loading...

Share This Page