Xpode.com        Click here to Print this article.

w3.org validation error: There is no attribute "border" In Image Button

Solution:
 
Delete Border properties in Image tag and Implement below procedure.
 
Place attached file in App_Code
 
 Add below tag in Web.Config

< pages>
< tagMapping>
< add tagType="System.Web.UI.WebControls.ImageButton"
mappedTagType="BorderlessImageButton" />
< /tagMapping>
< /pages>

Code:


Add attached file in App_Code Folder

				
using System;
using System.Web.UI.WebControls;

public class BorderlessImageButton : ImageButton
{
public override Unit BorderWidth
{
get
{
if (base.BorderWidth.IsEmpty)
return Unit.Pixel(0);
else
return base.BorderWidth;
}
set
{
base.BorderWidth = value;
}
}
}





http://
http://weblogs.asp.net/reganschroder/archive/2008/01/22/remove-border-width-0px-from-asp-image-or-asp-imagebutton.aspx

Contributed by:
Rohit kakria
I am software developer

Resourse address on xpode.com
http://www.xpode.com/Print.aspx?Articleid=325

Click here to go on website