Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




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

Download Attachment

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;
}
}
}



Helpful Website Url
http://weblogs.asp.net/reganschroder/archive/2008/01/22/remove-border-width-0px-from-asp-image-or-asp-imagebutton.aspx
Share this article   |    Print    |    Article read by 3610 times
Author:
Rohit kakria
I am software developer
Related Articles: No related article
Related Interview Questions: