|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
June 21st, 2006, 04:25 PM
|
Friend of Wrox
|
|
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
|
|
W3C XHTML Validation on ASP:Label control
Hi All
I have just hit an interesting problem... I am using a Masterpage with 2 contentplaceholder controls within it. The content fed into these placeholders can vary and on quite a few pages include <p> and <table> tags.
When trying to XHTML validate theses pages using http://validator.w3.org I can't get passed the following error:
document type does not allow element "table" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag .
One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "").
... What I have noticed is that the contentplaceholders produce <span> tags on the client side which stuff my validation up.
Has anyone found a way to overcome this obstacle? If so it would be great if you could share with all of us.
Warm Regards
Rit
__________________
Rit
www.designandonline.co.uk
INSPIRE | CREATE | DELIVER
|
June 22nd, 2006, 08:51 AM
|
|
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Rit,
Can you link to, or show us the code for the offending page?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
|
June 22nd, 2006, 05:12 PM
|
Friend of Wrox
|
|
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
|
|
Really sorry about this. I rushed into this one too quick.. Its not the contentplaceholder control but rather the Label control which I am using to deliver my data driven content.
It produces Span tags such as:
<span id="ctl00_MainContent_Content_pgContentLabel">MY CONTENT</span>
And according to the W3C error above, I am not allowed <table> or <p> nested within <SPAN> tags.
Is there a better way to deliver content rather than using a asp:Label control?
Many thanks
Rit
|
June 22nd, 2006, 05:15 PM
|
Friend of Wrox
|
|
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
|
|
When done with this string I will rename the title so that it is referring to my real issue rather than my misunderstanding... at least then it may be useful for others similar to me.
Ta
Rit
|
June 23rd, 2006, 01:26 AM
|
|
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Rit,
Right, I see. Indeed a label shouldn't be used for this kind of content. A label is just that, a piece of text describing or defining something.
I think what you're looking for is the asp:Literal control.
This control behaves more or less the same as the Label, but it doesn't render any markup itself.
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
|
June 26th, 2006, 06:58 AM
|
Friend of Wrox
|
|
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
|
|
Imar, Once again you are spot on.
A BIG thank you!
Rit
|
June 26th, 2006, 12:30 PM
|
|
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You're welcome....
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
|
|
|