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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top