Can not work out how ASP.NET valid HMTL pages to get [source note] [tricky problem]

Q: A condition for the current project is that the pages are HTML 4.01 strict – I just can not get ASP.NET to produce HTML.

I have already said the problem of browsers other than IE does not recognize resolved, but this seems a more difficult problem.

The specific problem is the hidden viewstate field, where I have no control programatically, but is not valid HTML.

Here s a snippet from the source (note that I have had to be cut down a bit just to be able to the post – I added “-” for every HTML tag) 0.

The specific error found by the W3C HTML Validator is: 977 503 977 503 “document type is not possible element” INPUT “here”.
Which means that the hidden input () tag should be enclosed in a div or similar tag.

Any ideas on how to fix it?


Re:Thanks so much! It's now working.
Unfortunately, I can't change to .net v2 – so I'm stuck with v1.1 – for work anyway.

However, that fix is certainly an ugly workaround – and I've no idea what the performance would be like on a busy site. But hopefully, as this is likely to be a relatively light load site this won't be a problem.


Re:Originally posted by: guy

Have you tried putting a div tag around the outside of the form?

Yes. It makes no difference.

In order for it to be valid HTML, the actual < input> tag must be enclosed in a div which is itself nested within the < form> tag.

ASP.NET places the < input> tag directly after the < form> tag, so you cannot simply place HTML code in the .aspx file. It just appears after the < input> tag.

I take it using the new version of asp.net is not an option? If not, try this article's technique… http://www.charon.co.uk/content.aspx?CategoryID=28&ArticleID=53


Re:Have you tried putting a div tag around the outside of the form?

Yes. It makes no difference.

In order for it to be valid HTML, the actual < input> tag must be enclosed in a div which is itself nested within the < form> tag.

ASP.NET places the < input> tag directly after the < form> tag, so you cannot simply place HTML code in the .aspx file. It just appears after the < input> tag.


Re:Have you tried putting a div tag around the outside of the form?

Re:The '-'s are there because you cannot post correctly formed tags to this forum.

The tags are correctly formed in the actual code.


Re:Why are there "-" in tags? They shouldn't be there

Related posts

Leave a comment

0 Comments.

Leave a Reply


click to changeSecurity Code

[ Ctrl + Enter ]