473,395 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ASP.NET image - remove border attribute (c#)

c#

by default the 'border' attribute is added to an asp.net image, how do
i remove this attribute, as i cant validate my page as xhtml 1.1

thanks
kb

Nov 19 '05 #1
4 4161
If you specify it like this

<asp:Image Runat="server" BorderWidth="0px" />

That is, specify it explicitly that you have BorderWidth 0px when it in IE
renders the width into style and there won't be the border attribute. To
make it work with other browsers (styles work by default only with uplevel
browsers), set Page's ClientTarget to uplevel (%@Page
ClientTarget="uplevel"%)

--
Teemu Keiski
ASP.NET MVP, Finland

<ke*********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
c#

by default the 'border' attribute is added to an asp.net image, how do
i remove this attribute, as i cant validate my page as xhtml 1.1

thanks
kb

Nov 19 '05 #2
<asp:Image ID="Image1" Runat="server" BorderStyle="None" />

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

<ke*********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
c#

by default the 'border' attribute is added to an asp.net image, how do
i remove this attribute, as i cant validate my page as xhtml 1.1

thanks
kb

Nov 19 '05 #3
Teemu,

doesn't BorderStyle override BorderWidth ?

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:Ox**************@TK2MSFTNGP14.phx.gbl...
If you specify it like this

<asp:Image Runat="server" BorderWidth="0px" />

That is, specify it explicitly that you have BorderWidth 0px when it in IE renders the
width into style and there won't be the border attribute. To make it work with other
browsers (styles work by default only with uplevel browsers), set Page's ClientTarget to
uplevel (%@Page ClientTarget="uplevel"%)

--
Teemu Keiski
ASP.NET MVP, Finland

<ke*********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
c#

by default the 'border' attribute is added to an asp.net image, how do
i remove this attribute, as i cant validate my page as xhtml 1.1

thanks
kb


Nov 19 '05 #4
KB
thanks for the replies, but using BorderStyle does remove the border
attribute, which is great!! but using this property, applies inline styling,
which cause other problems for me

how can i just render an asp.net image to have this output:

<img src="myImage" id="Image1">

your suggestion of using BorderStyle proves that the border attribute can be
removed, surely this can be done programmatically??

thanks
kb

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
<asp:Image ID="Image1" Runat="server" BorderStyle="None" />

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

<ke*********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
c#

by default the 'border' attribute is added to an asp.net image, how do
i remove this attribute, as i cant validate my page as xhtml 1.1

thanks
kb


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: j erickson | last post by:
with the following xsl and xml file, the display of the gif file with the <image/url> tag works. However, the gif file in the <description> tag using the name attribute "src" won't make the correct...
2
by: Rob Manger | last post by:
Hi All, I am hoping someone can help me. I am trying to setup my main page so that when the user moves the mouse over an image, it changes the source (got this working). When the user CLICKS...
4
by: miarte | last post by:
I have a form to allow the user upload images. The user browse for an image in their computer and click open, th image to be upload is preview on the img tag. The script works fine with IE, but...
9
by: Karl Burrows | last post by:
I am working on a Website for a non-profit group and for some reason I have one link that doesn't want to cooperate. All the image links work fine with the onmouseover and onmouseout script except...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
6
by: abdullah1983 | last post by:
Hi Guys, I need some clarification regarding the problem with safari browser. Please find my code below. I'm setting the image src, mouseover and mouseout using javascript. The mouseover and...
7
by: roN | last post by:
Hi, I have an image and I would like to draw a border around it, I tried: <p style="border:1px border-style:solid; border-color:#EEEEEE; background-color:#FFFFFF;"><img src="./images/header.jpg"...
21
by: JoernH | last post by:
Dear all, I am indeed a newbie and this may sound really simple. I would apreciate any help though. I am loading a bunch of images in my header, but would not like to show them before all...
2
by: runway27 | last post by:
hi i have set the border attribute to 0 for the img tag, however when an image is clicked which is a hyperlink, when the mouse is clicked there is a thin line that appears along the entire width...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.