Attribute not being added

S

shapper

Hello,

I am creating a control and I have the following:

Protected Overloads Overrides Sub AddAttributesToRender(ByVal
writer As HtmlTextWriter)
With writer
.AddAttribute(HtmlTextWriterAttribute.Id, Me.ClientID)
.AddAttribute(HtmlTextWriterAttribute.Class, Me.CssClass)
.AddAttribute(HtmlTextWriterAttribute.Bgcolor,
Me.BackColor.Name)
End With
MyBase.AddAttributesToRender(writer)
End Sub

The id and class attributes are being added but the bgcolor is not!
What am I doing wrong?

Thanks,

Miguel
 
M

Mike Placentra II

ASP.net doesn't render bgcolor for xHTML compliance. Try using CSS.

-Mike Placentra II
 
N

Nikron

shapper said:
Hello,

I am creating a control and I have the following:

Protected Overloads Overrides Sub AddAttributesToRender(ByVal
writer As HtmlTextWriter)
With writer
.AddAttribute(HtmlTextWriterAttribute.Id, Me.ClientID)
.AddAttribute(HtmlTextWriterAttribute.Class, Me.CssClass)
.AddAttribute(HtmlTextWriterAttribute.Bgcolor,
Me.BackColor.Name)
End With
MyBase.AddAttributesToRender(writer)
End Sub

The id and class attributes are being added but the bgcolor is not!
What am I doing wrong?

Thanks,

Miguel
try backColor or backgroundColor. This should work
 

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,940
Messages
2,570,109
Members
46,576
Latest member
TuyetArreo

Latest Threads

Top