PC Review


Reply
Thread Tools Rate Thread

Attribute not being added

 
 
shapper
Guest
Posts: n/a
 
      1st Oct 2007
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

 
Reply With Quote
 
 
 
 
Mike Placentra II
Guest
Posts: n/a
 
      2nd Oct 2007
ASP.net doesn't render bgcolor for xHTML compliance. Try using CSS.

-Mike Placentra II


On Oct 1, 11:52 am, shapper <mdmo...@gmail.com> wrote:
> 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


 
Reply With Quote
 
Nikron
Guest
Posts: n/a
 
      11th Oct 2007
shapper wrote:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Attribute 'Title' is not a valid attribute of element 'ProviderWebPart' etc.. rote Microsoft ASP .NET 5 29th Oct 2008 04:55 AM
Attribute 'ms_2d_layout' is not a valid attribute of element 'table' CdnRebel Microsoft ASP .NET 4 4th Jul 2007 07:56 PM
Validation (XHTML 1.0 Transitional): Attribute 'height' is not a valid attribute of element 'table' perspolis Microsoft ASP .NET 1 23rd Jan 2007 07:57 AM
Question about the word Attribute in attribute class names KJ Microsoft C# .NET 2 15th Sep 2006 06:02 PM
Validation (XHTML 1.0 Transitional): Attribute 'leftmargin' is not a valid attribute of element 'body'. anonymous Microsoft ASP .NET 1 2nd Aug 2006 09:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:37 PM.