.Net Image and ImageButton controls

By tim

Just had an issue where i'd taken CSS from a colleague and there was a class for an image which had a nice looking blue border with a few pixel of free space around all the edges

While converting the raw HTML into ASPX i added the image a server-side asp:Image instead.  However, .net uses some rather insane preprocessing to add some in-line CSS styles automatically, overriding the CSS style and removing the border

After a tiny google search, i had two options.  One was mentioned by the CSS developer in that i add "!important" to my CSS class.  The other is to make your own Image class, based on asp:Image, which has it's own setters and getter for borderwidth

http://www.spidermaster.org/blogs/spidermaster/archive/2008/01/22/remove-border-width-0px-from-asp-image.aspx

Related posts