This is a migrated thread and some comments may be shown as answers.

RadButton and W3C HTML Validation

5 Answers 100 Views
Button
This is a migrated thread and some comments may be shown as answers.
Marian
Top achievements
Rank 1
Marian asked on 07 Sep 2011, 05:31 PM
Hi to all,
I validated my XHTML Transitional page using W3C online validator and following error comming from RadButton was obtained
Line 192, Column 289: there is no attribute "align" 
…><span class="rbText rbPrimary" align="center">Obsah spravodajcu []</span><inp…✉ 
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 ....

My Radbutton is defined in markup:
<td style="width:190px;white-space:nowrap;text-align:right">
   <telerik:RadButton ID="btnDoc" runat="server" ButtonType="LinkButton" Width="190px"
        Text='<%# "Obsah spravodajcu [" + Utils.GetFileLengthFriendly(Server.MapPath("~/Documents/" +  Eval   ("Document"))) + "]" %>' NavigateUrl='<%# "~/Documents/" +  Eval("Document")%>' Target="_blank" Visible='<%# Eval("Document") != null %>' CausesValidation="false" CssClass="unwrapped">
        <Icon PrimaryIconUrl="~/Styles/icon_pdf.png" />
    </telerik:RadButton>    
 </td>

I can not find the reason why not allowed attribute align="center" is rendered for relevant span tag.
Any idea?
Thanks
-Marian

5 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 09 Sep 2011, 01:06 PM
Hello Marian,

The reason align is not allowed for non-table elements, is because it's not proper XHTML syntax. You're supposed to use float instead to align elements.

Now, I don't understand why your RadButton would have align text on the text property because I don't see it anywhere on the demo pages. Are you adding it yourself or is that how the control is rendering automatically?
0
Pero
Telerik team
answered on 12 Sep 2011, 10:26 AM
Hello Kevin,

Could you please elaborate how exactly do you perform the validation with the W3C validator? If you do it by URI (Validate by URI), then the W3C validator might present itself to the ASP.NET server as a very old browser, and that's why such attributes get applied to the <span/> element. Could you please view the page in some of the modern browsers (FireFox, IE9, Chrome), then View the Source of the page, copy it and "Validate by Direct Input"? I performed that and everything was OK.

Best wishes,
Pero
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Marian
Top achievements
Rank 1
answered on 13 Sep 2011, 03:47 PM
Hello Kevin & Pero,

thanks for your reply.
@Kevin: As you can see my markup, I do not put align property myself. It is rendered automatically - better to say w3c validator has found this property. Nevertheless if I open Show Source window in my IE8 browser no such property can be found. I am little confused in this matter.

@Pero: I use online validator http://validator.w3.org/check?uri=http%3A%2F%2Fwww.radola.sk%2Fobec%2Fbulletins&charset=%28detect+automatically%29&doctype=Inline&group=0&No200=1&user-agent=W3C_Validator%2F1.2
Page is online, you can inspect it.

Thanks
-Marian
0
Accepted
Pero
Telerik team
answered on 14 Sep 2011, 07:49 AM
Hi Marian,

As I said in my previous reply, the W3C validator (http://validator.w3.org) presents itself to the web server as a very old browser, and that's why the RadButton renders such HTML. Render the page in some modern browser (FireFox, Chrome, Safari, IE9, Opera), view the page source and then validate it by direct input. You will notice that everything is OK. Here is a video showing this: http://screencast.com/t/dYcbQ9tXhev.
We can configure the ASP.NET to perceive the W3Validator as a more capable browser by including a .browser file in the App_Browsers file. I have attached such file to the thread. Please include it in your application and test to see if you get the same behavior.

Best wishes,
Pero
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Marian
Top achievements
Rank 1
answered on 14 Sep 2011, 12:08 PM
Hi Pero,

thanks for your excellent explanation. Now is validation OK.
-Marian
Tags
Button
Asked by
Marian
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Pero
Telerik team
Marian
Top achievements
Rank 1
Share this question
or