Prevent tag properties automaticaly generated by ASP.NET

H

Henri

When I use System.Web.UI.WebControls.Image, ASP.NET automaticaly outputs :
<img border="0" />
Is there a way to prevent this border="0" to be added, without creating a
custom Control?
 
T

Teemu Keiski

Hi,

Image control works such that if the BorderWidth property is considered to
be empty, it outputs the '0', And this logic happens in rendering phase of
the Image control, so it can be changed, unless you write a custom control
or use <img runat="server">, that is a HTML server control. They are
rendered exactly as you want them to be.
 
H

Henri

Thanks a lot for your help Teemu!
I use HtmlControls.HtmlImage instead of WebControls.Image and everything's
OK now!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top