How to get valid XHTML from the framework????

A

Alan Silver

Hello,

I thought that ASP.NET 2.0 was supposed to output valid XHTML 1.0. I've
just spent a very frustrating time trying to fix all the validation
errors in framework-produced code.

I posted previously (but haven't had any replies yet) about the
framework adding a "name" attribute to the form, even though this
doesn't exist in XHTML 1.0.

I've now discovered that when you use a treeview, it adds the
following...

<script>
<!--
function TreeView_PopulateNodeDoCallBack(context,param) {
WebForm_DoCallback(context.data.treeViewID,param,TreeView_Process
NodeData,context,TreeView_ProcessNodeData,false);
}
// -->
</script>

which is invalid as the <script> tag needs a "type" attribute.

Anyone know if there's a way of getting it to produce valid XHTML? I've
hardly started, and I've already found quite a few validation issues.
 
G

Guest

Alan,
Thank you for making the internet a more useable place for the <1% that need
XHTML conformance today.

Sincerely
DWS
 
J

Joerg Jooss

Thus wrote DWS,
Alan,
Thank you for making the internet a more useable place for the <1%
that need XHTML conformance today.

There are rules and regulations in certain countries that stipulate the use
of valid XHTML, e.g. to allow for accessibility technologies like screen
readers. You probably don't care, but you're customer may do...

Cheers,
 
B

Bruce Barker

type is not required. you can supply a meta tag default the script type.

<META http-equiv="Content-Script-Type" content="text/javascript">


-- bruce (sqlwork.com)
 
P

Peter Blum

Hi Alan,

I have found a few XHTML bugs too. As a custom control developer, I don't
have any choice but to try to get 100% compliance of my web controls.

I've used the Microsoft bug reporting system to notify them about bugs. Its
essential that you do the same.

You can get to it here:
http://lab.msdn.microsoft.com/ProductFeedback/default.aspx

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 
A

Alan Silver

DWS said:
Alan,
Thank you for making the internet a more useable place for the <1% that need
XHTML conformance today.

What was the point of this comment? If you don't have anything sensible
to say, please don't bother.
 
A

Alan Silver

Bruce Barker said:
type is not required. you can supply a meta tag default the script type.

<META http-equiv="Content-Script-Type" content="text/javascript">

Thanks, but this didn't help. The script tag itself still needs a type
attribute for validity.

Any other ideas? Other than not using the treeview altogether!! Thanks.
-- bruce (sqlwork.com)
 
A

Alan Silver

Peter Blum said:
Hi Alan,

I have found a few XHTML bugs too. As a custom control developer, I don't
have any choice but to try to get 100% compliance of my web controls.

I've used the Microsoft bug reporting system to notify them about bugs. Its
essential that you do the same.

Thanks. Have you had any success using this? I submitted a couple of
(admittedly minor) bug reports using this, and there hasn't been the
slightest hint of anyone taking any notice of them.

Ta ra
You can get to it here:
http://lab.msdn.microsoft.com/ProductFeedback/default.aspx

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 
A

Alan Silver

Peter Blum said:
I have found a few XHTML bugs too. As a custom control developer, I
don't have any choice but to try to get 100% compliance of my web
controls.

Have you ever seen a "name" attribute added to the form? I am having
this problem at the moment and can't see how to fix it.

My server side code is...

<form id="Form1" runat="server">

....and the resulting output looks like...

<form name="aspnetForm" method="post" action="Default.aspx"
id="aspnetForm">

Ever seen this? It's stopping my pages from validating. Any suggestions
as to how to avoid it would be very welcome.
 
Joined
Jul 28, 2006
Messages
1
Reaction score
0
Valid XHTML from asp.net 2.0

This will sort your name parameter issue in ASP.NET 2.0 RTM

<system.web>
<xhtmlConformance mode="Strict" />
</system.web>

Options are Strict, Transitional, Legacy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top