Hi all,
I tried to upgrade from ASP.NET pervious version to ASP.NET 2.0, but I got all these errors:
Error 2 Validation (XHTML 1.0 Transitional): Element 'html' is missing required attribute 'xmlns'.
Error 3 Validation (XHTML 1.0 Transitional): Empty elements such as 'meta' must end with />.
Error 4 Validation (XHTML 1.0 Transitional): Element 'script' is missing required attribute 'type'.
Error 6 Validation (XHTML 1.0 Transitional): Attribute 'height' is not a valid attribute of element 'table'.
Error 18 Validation (XHTML 1.0 Transitional): Element 'script' is missing required attribute 'type'.
Error 20 Validation (XHTML 1.0 Transitional): Empty elements such as 'img' must end with />.
Error 22 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 23 Validation (XHTML 1.0 Transitional): Empty elements such as 'IMG' must end with />.
Error 24 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 25 Validation (XHTML 1.0 Transitional): Element 'html' is missing required attribute 'xmlns'.
Error 26 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 27 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 28 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 29 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 30 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 31 Validation (XHTML 1.0 Transitional): Empty elements such as 'META' must end with />.
Error 36 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 39 Validation (XHTML 1.0 Transitional): This attribute name must be followed by an equal (=) sign and a value. If the value is in quotation marks, the quotation marks must match.
Error 43 Validation (XHTML 1.0 Transitional): Empty elements such as 'br' must end with />.
Error 44 Validation (XHTML 1.0 Transitional): Empty elements such as 'br' must end with />.
Error 47 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 48 Validation (XHTML 1.0 Transitional): Empty elements such as 'br' must end with />.
Error 49 Validation (XHTML 1.0 Transitional): Empty elements such as 'br' must end with />.
......
I got hundreds of errors and warnings.
Do I have to go and change manually all the aspx and html pages?? there will be hundreds of changes!!
Also the upgarde create a new code then there an error in the code that he created?(App_Web_bojdxrs-.4.cs 213 ) what is all these codes that has been created in temprory folder? C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
In v2, Microsoft have gone with XHTML 1.0 Transitional as the default doctype on pages. In v1.1, the default doctype was HTML 4.0 Transitional.
As you've no-doubt guessed, you're now working with a much more strict standard. So you have 2 options:
Change all your HTML as the warnings suggest. This will make your pages XHTML compatible - which is a good thing.
Go back to HTML 4.0 Transitional. You can do this by changing the doctype declaration at the top of your pages as follows:
You can also read more about doctypes at the
w3 schools site.
Regarding the temporary code, this is part of the "on-the-fly" compiling of the v2 framework. If you find that you're getting errors in there, sometimes it helps to manually delete all the files in that temporary directory. You'll be best to run IISRESET
before you do that, though.
The quickest way to get rid of the build errors is to turn off validation, which is on by default. In Visual Studio 2005, with your project open if you only want to affect one project, go to menu option Tools then Options.
In the Options dialog navigate to Text Editor, HTML, Validation. Uncheck the Show Errors option for your target browser. Build again and you won't see the validation errors.[H]
The quickest way to get rid of the build errors is to turn off validation, which is on by default. In Visual Studio 2005, with your project open if you only want to affect one project, go to menu option Tools then Options.
In the Options dialog navigate to Text Editor, HTML, Validation. Uncheck the Show Errors option for your target browser. Build again and you won't see the validation errors.[H]
The Visual Web Developer designer doesn't directly use the <!DOCTYPE ... > element at the top of the page for design-time validation -- that's just the way you advertise which language the page was written in to the browsers/search bots/etc. that request
the page. The validation target used for the validation errors you asked about is actually found in a dropdown in the "HTML Source Editing" toolbar that should be visible by default when editing an ASPX page in Source View. You could turn validation off
entirely, but you generally should pay attention to these errors since they make it harder to machine-parse your content.
Pressing Ctrl K, D (hold control and press k then d) will fix many of these errors. The rest are fairly easy to change. It does take some time, but I applaude MS for trying to push the newer XHTML standards.
and search and replace for <br> to <br /> helps a lot too
In general, I find the strict validation useful, but is there a way to customize what gets (or more importantly: doesn't get) flagged? Not something general like, "when client tags are not lowercase" inside tools->options but something specific...
The web stats package I use needs a non-standard attribute stats="1" added inside the
<body> tag for any page I need kept track. So for the hundreds of pages on the site, this validation error spams the error list:
Attribute 'stats' is not a valid attribute of the element 'body'.
How do I configure VS or at least the project to ignore this (and other) specific "errors" so I don't have to turn off the error list entirely?
SlaveOf1
Member
10 Points
2 Posts
Problems upgarding to ASP.NET 2.0
Sep 29, 2005 05:51 PM|LINK
I tried to upgrade from ASP.NET pervious version to ASP.NET 2.0, but I got all these errors:
Error 2 Validation (XHTML 1.0 Transitional): Element 'html' is missing required attribute 'xmlns'.
Error 3 Validation (XHTML 1.0 Transitional): Empty elements such as 'meta' must end with />.
Error 4 Validation (XHTML 1.0 Transitional): Element 'script' is missing required attribute 'type'.
Error 6 Validation (XHTML 1.0 Transitional): Attribute 'height' is not a valid attribute of element 'table'.
Error 18 Validation (XHTML 1.0 Transitional): Element 'script' is missing required attribute 'type'.
Error 20 Validation (XHTML 1.0 Transitional): Empty elements such as 'img' must end with />.
Error 22 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 23 Validation (XHTML 1.0 Transitional): Empty elements such as 'IMG' must end with />.
Error 24 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 25 Validation (XHTML 1.0 Transitional): Element 'html' is missing required attribute 'xmlns'.
Error 26 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 27 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 28 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 29 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 30 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 31 Validation (XHTML 1.0 Transitional): Empty elements such as 'META' must end with />.
Error 36 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 39 Validation (XHTML 1.0 Transitional): This attribute name must be followed by an equal (=) sign and a value. If the value is in quotation marks, the quotation marks must match.
Error 43 Validation (XHTML 1.0 Transitional): Empty elements such as 'br' must end with />.
Error 44 Validation (XHTML 1.0 Transitional): Empty elements such as 'br' must end with />.
Error 47 Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
Error 48 Validation (XHTML 1.0 Transitional): Empty elements such as 'br' must end with />.
Error 49 Validation (XHTML 1.0 Transitional): Empty elements such as 'br' must end with />.
......
I got hundreds of errors and warnings.
Do I have to go and change manually all the aspx and html pages?? there will be hundreds of changes!!
Also the upgarde create a new code then there an error in the code that he created?(App_Web_bojdxrs-.4.cs 213 ) what is all these codes that has been created in temprory folder? C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
Any idea?
Abdu.
gerrod
Member
145 Points
29 Posts
Re: Problems upgarding to ASP.NET 2.0
Sep 30, 2005 03:07 PM|LINK
In v2, Microsoft have gone with XHTML 1.0 Transitional as the default doctype on pages. In v1.1, the default doctype was HTML 4.0 Transitional.
As you've no-doubt guessed, you're now working with a much more strict standard. So you have 2 options:
You can also read more about doctypes at the w3 schools site.
Regarding the temporary code, this is part of the "on-the-fly" compiling of the v2 framework. If you find that you're getting errors in there, sometimes it helps to manually delete all the files in that temporary directory. You'll be best to run IISRESET before you do that, though.
HTH -
/gerrod
SlaveOf1
Member
10 Points
2 Posts
Re: Problems upgarding to ASP.NET 2.0
Sep 30, 2005 09:12 PM|LINK
I changed the pages headers to support HTML 4.0 Transitional.
<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >But u'm still getting the same errors:
Validation (XHTML 1.0 Transitional): Element 'html' is missing required attribute 'xmlns'..
Any idea?
Thanks.
Abdu.
kazzmeister
Member
10 Points
2 Posts
Re: Problems upgarding to ASP.NET 2.0
Oct 12, 2005 02:57 PM|LINK
bloomk
Member
15 Points
4 Posts
Re: Problems upgarding to ASP.NET 2.0
Dec 07, 2005 06:28 PM|LINK
awesome! i needed that... thanks...
ClayCo
Participant
1548 Points
292 Posts
Microsoft
Re: Problems upgarding to ASP.NET 2.0
Dec 16, 2005 09:34 PM|LINK
Hello Abdu,
The Visual Web Developer designer doesn't directly use the <!DOCTYPE ... > element at the top of the page for design-time validation -- that's just the way you advertise which language the page was written in to the browsers/search bots/etc. that request the page. The validation target used for the validation errors you asked about is actually found in a dropdown in the "HTML Source Editing" toolbar that should be visible by default when editing an ASPX page in Source View. You could turn validation off entirely, but you generally should pay attention to these errors since they make it harder to machine-parse your content.
HTH,
Clay
Supergibbs
Member
202 Points
47 Posts
Re: Problems upgarding to ASP.NET 2.0
Feb 13, 2006 06:54 PM|LINK
and search and replace for <br> to <br /> helps a lot too
-Jesse
lonechicken
Member
74 Points
21 Posts
Re: Problems upgarding to ASP.NET 2.0
Feb 22, 2006 02:07 PM|LINK
In general, I find the strict validation useful, but is there a way to customize what gets (or more importantly: doesn't get) flagged? Not something general like, "when client tags are not lowercase" inside tools->options but something specific...
The web stats package I use needs a non-standard attribute stats="1" added inside the <body> tag for any page I need kept track. So for the hundreds of pages on the site, this validation error spams the error list: Attribute 'stats' is not a valid attribute of the element 'body'.
How do I configure VS or at least the project to ignore this (and other) specific "errors" so I don't have to turn off the error list entirely?
lokanatha
Member
4 Points
3 Posts
Re: Problems upgarding to ASP.NET 2.0
Apr 24, 2007 04:06 PM|LINK
Hi Friend,
Instead you can add
<
html xmlns="http://www.w3.org/1999/xhtml">which almost eliminates your problem. bcoz i did this way only i got out of the problem.
bindubn
Member
2 Points
2 Posts
Re: Problems upgarding to ASP.NET 2.0
Oct 16, 2008 06:53 PM|LINK
Thanks. It really solved the error.