Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML validation from W3C

Status
Not open for further replies.

bizzydint

Programmer
Mar 6, 2003
11
GB
I'm attempting to get the site to have valid HTML but it seems that the built in .NET controls (eg image buttons) write out html with attributes which are not accepted by the HTML validator (
My code reads:
<asp:imagebutton id=&quot;btnLogin&quot; onclick=&quot;doLogin&quot; tabIndex=&quot;3&quot; Runat=&quot;server&quot; imageurl=&quot;enterButton.gif&quot; width=&quot;45&quot; height=&quot;18&quot; EnableViewState=&quot;False&quot;></asp:imagebutton>


The outputted HTML is:
<input type=&quot;image&quot; name=&quot;btnLogin&quot; id=&quot;btnLogin&quot; tabindex=&quot;3&quot; src=&quot;enterButton.gif&quot; border=&quot;0&quot; style=&quot;height:18px;width:45px;&quot; />


According to the validation report, there is no &quot;border&quot; attribute of the INPUT tag. Is there a way to stop this being put in????

cheers
van.
 
try using a style attribute for the tag instead

I'm not up on the validator and not sure how it will interprute it

_____________________________________________________________________
onpnt2.gif

The answer to your ??'s may be closer then you think.
Check out Tek-Tips knowledge bank by clicking the FAQ link at the top of the page
 
What doctype are you using? Depending on the DOCTYPE some attributes are/aren't allowed... You should be able to get the border attribute through on XHTML1.0 Transitional but not Strict.

To be honest though the X/HTML support in ASP.NET is CR@P - in fact scratch that it is absolutely appalling and incredibly unprofessional. I suspect this is due to many different teams with differing opinions on the value of HTML standards working on the development of the overall framework at M$oft.

Some web controls render entirely valid XHTML some still render some real nasties like font tags (Shock Horror surely NO ONE has used these in the last 2 years - have they?). The use of tables for nearly all constructs regardless of wether they are for data etc is standards wise valid but still semantically poor practice.

This is across the board for all current web based .NET products. CMS Server is like a horrible nightmare for the standards concious developer!

All we can do is wait for the promised changes to ASP.NET 2.0 which will include full XHTML1.0 and CSS2.0 support.

Excuse the rant - touched on a personal bugbear there....:)

Rob

Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top