HtmlSelect showing Value when Text is blank

T

Tom

I have two ASP.NET (v1.1) websites running a modified version of the same
code - they live on the same IIS6 server in separate virtual websites, with
separate application pools.

Each has exactly the same code for the population of a HtmlSelect control,
where the HTML is as follows, and the codebehind populates the rest of the
values.
<select runat="server" id="selTitle">
<option value="0"></option>
</select>

Here's the problem: one website (correctly) has the first item in the
dropdown as blank text, and the other (incorrectly) has the text "0"... and
I can find no reason what-so-ever why it is doing it.
(I have also tried <option value="0">&nbsp;</option> without success.)

I've checked and compared everything including IIS configuration,
machine.config, web.config, project settings... I just can't figure it out.

Any help would be very much appreciated.
Cheers,
Tom
 
T

Tom

Thank you for your reply Eliyahu, but I now hang my head in shame.
The problem was that it was running under ASP.NET 2.0 and not 1.1.

After reading the following excellent article, it all became clear...
http://weblogs.asp.net/owscott/arch...-without-forcing-an-upgrade-on-all-sites.aspx

The server was running under 2.0 as standard, and the original website had
been configured to use 1.1 specifically... something that hadn't been done
to the new website.

Tom


Eliyahu Goldin said:
View html source for both pages in browser and compare them. Most likely,
there is a problem on server side and the resulting html are different.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


Tom said:
I have two ASP.NET (v1.1) websites running a modified version of the same
code - they live on the same IIS6 server in separate virtual websites,
with separate application pools.

Each has exactly the same code for the population of a HtmlSelect
control, where the HTML is as follows, and the codebehind populates the
rest of the values.
<select runat="server" id="selTitle">
<option value="0"></option>
</select>

Here's the problem: one website (correctly) has the first item in the
dropdown as blank text, and the other (incorrectly) has the text "0"...
and I can find no reason what-so-ever why it is doing it.
(I have also tried <option value="0">&nbsp;</option> without success.)

I've checked and compared everything including IIS configuration,
machine.config, web.config, project settings... I just can't figure it
out.

Any help would be very much appreciated.
Cheers,
Tom
 

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,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top