crazy behaviour from controls

C

Chris Szabo

Hey everyone... this is nuts... really hope someone can
help out.

I've got eight HtmlSelect controls on the web form. They
each are set to runat server. When the page is loaded,
they are filled using data from a database and a loop that
creates the listitems and adds them, no databinding.

If there is a query string value on the page, I set the
value and selected index of each control to the data that
corresponds to the id in the querystring. Here's where it
goes nuts...

I can step through the code in VS.Net and actually watch.
When one of the eight controls has it's value set, all the
controls get set to that value. This happens for each of
the eight, so after the page loads, they all have the last
value.

I've tried using asp:dropdownlists and the same thing
happens. I've tried setting the values statically in the
code behind to, just giving them an arbitrary value that's
in the list, same thing happens.

Anyone have any ideas?

if ( levels [ 1 ].IndexOf ( "Any" ) != -1 )
{
ddlAdventureRatingBottom.Disabled = true;
ddlAdventureRatingTop.Disabled = true;
chkAdventureAllRatings.Checked = true;
}
else
{
ddlAdventureRatingBottom.Value = filterNumbers (
levels [ 1 ], 1 );
ddlAdventureRatingTop.Value = filterNumbers (
levels [ 1 ], 2 );
}

if ( levels [ 2 ].IndexOf ( "Any" ) != -1 )
{
ddlCraftingLevelBottom.Disabled = true;
ddlCraftingLevelTop.Disabled = true;
chkCraftingAllLevels.Checked = true;
}
else
{
ddlCraftingLevelBottom.Value = filterNumbers (
levels [ 2 ], 1 );
ddlCraftingLevelTop.Value = filterNumbers ( levels
[ 2 ], 2 );
}
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top