Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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
 
Old March 2nd, 2009, 11:31 AM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 194
Thanks: 5
Thanked 3 Times in 3 Posts
Default xhtml 1.1 strict

I know this isn't strictly to do with your book but you have been pretty helpful so I wanted to pick your brain about this problem.

I am currently working on a website but it needs to generate valid xhtml 1.1 and currently it doesn't. I have the following doctype in the pages:

HTML Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


<html xmlns="http://www.w3.org/1999/xhtml"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xml:lang="en" >
and I had read in the msdn documentation that by adding this to the webconfig file:

Code:
<xhtmlConformance mode="Strict"/>
That it would make the asp.net generate valid 1.1 code but it doesn't seem to work and Visual Studio 2008 is still automatically uppercasing some of my letters in tags and stuff.

So do you know how to overcome this?
 
Old March 2nd, 2009, 02:11 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Will,

Can you define "currently it doesn't.". Are there specific controls you're having problems with?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old March 2nd, 2009, 03:09 PM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 194
Thanks: 5
Thanked 3 Times in 3 Posts
Default

Yup ok When I go to validate the page I get these errors:

http://validator.w3.org/check?verbos...kerdsgn.com%2F

Primarily I believe it is the contact page which is causing the most trouble.

The page also generates code like this:

Code:
<asp:Label runat="server" ID="lblMessage" Text="Message:" />
So If i wanted it to validate in 1.1 all the tags have to be lower case, so even if I type them out in lower case soon as I close the page and re open it, it reformats it as upper and lower case as shown above.
 
Old March 2nd, 2009, 03:11 PM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 194
Thanks: 5
Thanked 3 Times in 3 Posts
Default

here are the validation errors that come up aswell:

Quote:
  1. Line 17, Column 15: there is no attribute "name". <form name="aspnetForm" method="post" action="Default.aspx" id="aspnetForm">
    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
  2. http://validator.w3.org/images/info_icons/error.png Line 18, Column 119: document type does not allow element "input" here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "address", "fieldset" start-tag.…YzMjhkZB2GqNOiJyE+Y6nwqzvKpmZbCptj" />
    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
    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 "<font>").
  3. http://validator.w3.org/images/info_icons/error.png Line 3, Column 5: XML Parsing Error: XML declaration allowed only at the start of the document.<?xmlversion="1.0" encoding="UTF-8"?>
 
Old March 2nd, 2009, 03:34 PM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 194
Thanks: 5
Thanked 3 Times in 3 Posts
Default

Nevermind I figured it out I just had to put

Code:
<?xml version="1.0" encoding="UTF-8"?>
At the very top of the page. Thanks for your time anyway.
 
Old March 2nd, 2009, 03:37 PM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 194
Thanks: 5
Thanked 3 Times in 3 Posts
Default

Ok well that supposedly fixed it when its local but when uploading to my server and checking the validation it still doesn't validate which I find very odd.
so I still have the problem.
 
Old March 2nd, 2009, 03:51 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
So If i wanted it to validate in 1.1 all the tags have to be lower case, so even if I type them out in lower case soon as I close the page and re open it, it reformats it as upper and lower case as shown above.
Take another look at page 20, and the TIO before it. There is a *major* difference between the ASP.NET controls you define in an ASPX page and the actual HTML that gets sent to the browser. So, the ASP.NET controls don't have to be valid at all; they are just there to define the ASP.NET controls; it's the final HTML that matters.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old March 2nd, 2009, 03:56 PM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 194
Thanks: 5
Thanked 3 Times in 3 Posts
Default

Yup gotcha I knew that lol, I was just testing you... The green lines that come up everywhere on the page confuse me.

Anyway the page still doesn't validate because it doesn't generate the correct code, is there not a way around this, does it not support 1.1 fully yet?
 
Old March 2nd, 2009, 04:02 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The page as you see it is probably valid XHTML. The problem is that the W3C validator doesn't tell the ASP.NET framework it's capable of handling XHTML strict 1.1 so ASP.NET serves it downlevel markup instead. This in turn causes page validation fail.

Check out the section "Configuring Browser Capabilities for Markup Validation" of this article: http://msdn.microsoft.com/en-us/library/exc57y7e.aspx

Just testing me, he?..... ;-) Does that mean I can safely ignore other questions you're going to post here if I don't care to be tested? ;-)

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old March 2nd, 2009, 04:06 PM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 194
Thanks: 5
Thanked 3 Times in 3 Posts
Default

Thanks for the link.

Well I wouldn't go that far lol, I might not be quite that good yet...

Cheers again.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Strict Javascript newbieboobers Javascript 1 July 28th, 2008 05:23 AM
accesing a form with Strict XHTML 1.0 furia_cross Javascript How-To 2 August 27th, 2005 09:48 AM
Option Strict kevin777 VB.NET 2002/2003 Basics 2 October 10th, 2003 11:38 PM
XHTML Strict Frame Borders Alexpizzoferro HTML Code Clinic 4 September 21st, 2003 11:54 AM
no target attribute in XHTML strict Alexpizzoferro HTML Code Clinic 3 June 22nd, 2003 04:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.