473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

asp:Label rendering as <span> in IE :(

Hello,

I have a site which I've been developing locally with VS2k3 Pro. I
have some browsercap information in my web.config to help identify
Firefox as an upscale browser. It works great locally. Labels render
as labels and so on.

However, when deploying the site onto a different server, all my Labels
render as <spans>, even in IE. I don't understand what's going on, I
haven't had this happen to me before. What discrepencies between the
configuration of IIS (or whatever) could exist between my local machine
and the server? As far as I can tell, I've copied everything over to
the server including the web.config with the browsercap info. I might
have expected this to happen with Firefox if I failed to update the
remote web.config, but the fact it's happening with IE is totally
stumping me.

Any ideas as to what's going on?

The Labels render as <span AssociatedControlID="foo">bar</span>. The
local development machine is XP Pro SP2 and the server is Win2k SP4.

Thank you for any advice!

Garth

Mar 11 '06 #1
5 8989
Labels always render as <span>s in IE.

<ga****@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
Hello,

I have a site which I've been developing locally with VS2k3 Pro. I
have some browsercap information in my web.config to help identify
Firefox as an upscale browser. It works great locally. Labels render
as labels and so on.

However, when deploying the site onto a different server, all my Labels
render as <spans>, even in IE. I don't understand what's going on, I
haven't had this happen to me before. What discrepencies between the
configuration of IIS (or whatever) could exist between my local machine
and the server? As far as I can tell, I've copied everything over to
the server including the web.config with the browsercap info. I might
have expected this to happen with Firefox if I failed to update the
remote web.config, but the fact it's happening with IE is totally
stumping me.

Any ideas as to what's going on?

The Labels render as <span AssociatedControlID="foo">bar</span>. The
local development machine is XP Pro SP2 and the server is Win2k SP4.

Thank you for any advice!

Garth

Mar 12 '06 #2
Peter, thank you for your response!

Shouldn't Labels render as <label>s if an associated control ID is set?
That's the behaviour I'm used to. The form this is a part of requires
the semantics of a <label> to achieve the required degree of
accessibility.

Anyone else have any suggestions?

Thank you,
Garth

Mar 12 '06 #3
I want to second what you were told the first time, that IE always renders
Labels as Span tags, I don't think I've ever seen them rendered as anything
else. I think that Label Controls are rendered as <span> tags because they
are more generic, therefore allowing ASP.NET to more easily make them look
the way you designed them (this is why you don't see ASP.NET creating tags
such as h1, h2, h3, etc.). If you want a Control to be rendered as a
specific HTML tag, my recommendation would be to create a UserControl that
uses Controls from the System.Web.UI.HtmlControls namespace. I haven't seen
your exact code, so I don't know why you need the code to generate <label>
tags, but in my opinion it is better to stick with <span> because I think it
is more widely supported. Also, if your code "requires" <label> tags (or any
other specific tag), I would recommend looking it over because it sounds
somewhat inefficient, and if you are preventing yourself from using the
built-in Controls such as Label, you will be putting yourself through a lot
of extra work to get less productive results. Good Luck!
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

<ga****@gmail.com> wrote in message
news:11********************@z34g2000cwc.googlegrou ps.com...
Peter, thank you for your response!

Shouldn't Labels render as <label>s if an associated control ID is set?
That's the behaviour I'm used to. The form this is a part of requires
the semantics of a <label> to achieve the required degree of
accessibility.

Anyone else have any suggestions?

Thank you,
Garth

Mar 12 '06 #4
The merits of using <label>s versus other less "inefficient" tags is a
discussion for another forum, but in the context of this thread I guess
I'm going to have to find another way to generate them. Here is
something interesting I found on MSDN.

===========
http://msdn2.microsoft.com/en-us/lib...ntrolid.aspx):

When the AssociatedControlID property is set, the Label control renders
as an HTML label element, with the for attribute set to the ID property
of the associated control. You can set other attributes of the label
element using the Label properties. For example, you can use the Text
and AccessKey properties to provide the caption and hot key for an
associated control.
===========

The HUGE caveat here is that this page also says it's "new for .Net
2.0"!! I do have 2.0 installed on my machine, but I expected VS2k3 to
continue using 1.1. The easy fix for me to try here, then, is to
install 2.0 on the server...

Thanks for everyones input!

Garth

Mar 12 '06 #5
To close off this thread, I discovered that even though my local
website definition in IIS is set to use .Net 1.1, it's using 2.0. I
verified this by installing 2.0 on the server. The installation of 2.0
didn't solve my problem until I set the website to actually use 2.0,
then Labels rendered as <labels>.

In other words, other than my local IIS apparently not doing what it
should, everything is working as it is supposed to, including have
Label's rendering as <span>s in 1.1 and having them render as <label>s
in 2.0.

Thanks again to Peter and Nathan for kicking me in the right direction!

Garth

Mar 12 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kerri | last post by:
Hi, I have a span as below. <span id="lblTest" style="color:#FF0033;font- weight:bold;">This is a test.</span> When the user clicks a checkbox I call below code to set my span text to...
1
by: C | last post by:
Hi, I have a link on an asp page. When the user clicks on this link I make a <span> visible. Within my span I have a series of textboxes. In Netscape 6.0 and 7.0 these textboxes are...
1
by: CLS | last post by:
Howdy, How do you write pure text out from a label? I don't want the <span> tags. For example: <script> Owner_FullName.Text = "Lynn Solomon" </script>
9
by: Wang, Jay | last post by:
Hello, all, I would like to enable some text between <SPAN url="http://www.testserver.com/">WORD TO BE DRAGGED </SPAN>. I put some javascript and it will extract http://www.testserver.com/ from...
2
by: Ante Perkovic | last post by:
Hi, I noticed that client-side validation (in IE6) is done with <span> tags that have the same attributes as in original aspx code (controlToValidate and others...). I noticed that, when i save...
2
by: Don Wash | last post by:
Hi There! I'm creating my website with ASP.NET + XHTML, which means I will strictly adhere the XHTML standards for my web page output. I use Panel or PlaceHolder WebControls to place...
2
by: Andrei Pociu | last post by:
Is there some way to make the label not add a <span> tag? For example I don't need any styles applied or position set so I could as well get rid of <span>. Or is there some other type of control...
1
by: Fao, Sean | last post by:
I'm trying to set the title attribute on a CheckBox and I'm having some issues in ASP.NET 1.1. The title attribute in the following example is valid in HTML 4.01 Transitional: <input...
10
by: fjleon | last post by:
Hi, i am stuck using older ASP and have to dinamically fill a converted-word file as a form. Let´s suppose a row on a table has the name of someone like in a declaration: <span>Some random...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.