W3C validator – “there is no attribute “border””

When you try to validate your page with W3C Markup Validation Service at the line when you have an ImageButton like this:

<asp:ImageButton runat="server" ToolTip="Click here to load new image" ID="ImageButtonRefresh" ImageUrl="images/refresh.png" OnClick="ImageButtonRefresh_Click" CausesValidation="false" />

show the following error message:

there is no attribute “border”

Cause:
<asp:ImageButton> renders a border=”0″ output.

Solution:
Add ClientTarget=”uplevel” in your page’s Page directive, for example:

<%@ Page Language="c#" MasterPageFile="~/MasterPage.master" ClientTarget="uplevel" %>

Did my solution solve your problem? Leave a reply.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.