Attribute not being added

  • Thread starter Thread starter shapper
  • Start date Start date
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
 
ASP.net doesn't render bgcolor for xHTML compliance. Try using CSS.

-Mike Placentra II
 
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
 
Back
Top