DropDownList SelectedValue property changed behaviour in .NET 3.5

Discussion in 'ASP .Net' started by Slavan, Feb 5, 2009.

  1. Slavan

    Slavan Guest

    Hello,

    We just discovered a bug in our application that was initially created
    in .NET 1.1 and later migrated to 2.0, after installing .NET 3.5 with
    all latest service packs.
    Here's the problem:

    ..NET 1.1/2.0 Behaviour
    When you do something like this, first time you load page

    ddlSomeDropDown.SelectedValue = "Non existent value" // Does not do
    anything, keeps selected value empty string

    After postback, the same line has same behaviour, it doesn't do
    anything.

    Now after installing .NET 3.5 and all latest service packs:
    First time you load a page:

    ddlSomeDropDownList.SelectedValue = "Non existent value" // Does not
    do anything, keeps selected value empty string

    After postback same line throws ArgumentOutOfRangeException.

    I tried this in debugger with 1.1 and 3.5.

    Documentation says it should throw this exception for all versions
    of .NET, but it looks like they fixed it only in one of the latest
    service packs. Our application have lots of places with this kind of
    code, and we need to fix it everywhere. I'm not saying that Microsoft
    should not fix bugs in their frameworks, but they should at least say
    what they fixed that can cause side effects.
    Also, I'm not sure if there were any other fixes that may cause side
    effects. If anyone knows of a document of fixes that may cause side
    effects, please let me know.

    Thanks.
    Slavan, Feb 5, 2009
    #1
    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. Jesse
    Replies:
    3
    Views:
    1,222
    DudeGuy
    Jul 24, 2003
  2. Tom Jorgenson
    Replies:
    3
    Views:
    7,009
  3. Replies:
    1
    Views:
    671
    Rosanne
    Oct 11, 2005
  4. Abraham Andres Luna

    how to override DropDownList.SelectedValue property

    Abraham Andres Luna, Nov 10, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    981
    Abraham Andres Luna
    Nov 10, 2005
  5. mxbrunet
    Replies:
    1
    Views:
    201
Loading...

Share This Page