DropDownList SelectedValue property changed behaviour in .NET 3.5

S

Slavan

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top