473,322 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Attribute not being added

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

Oct 1 '07 #1
2 1126
ASP.net doesn't render bgcolor for xHTML compliance. Try using CSS.

-Mike Placentra II
On Oct 1, 11:52 am, shapper <mdmo...@gmail.comwrote:
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
Oct 2 '07 #2
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
Oct 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
4
by: smita | last post by:
Hi, I have an xml file as below <root> <table id =1> <user>abc</user> <age>25</age> </table> <table id = 2> <user>xyz</user>
2
by: Bill Cohagan | last post by:
In my app I'm validating an XML file against an XSD which contains several attribute default value specifications. I'm performing the validation via an xml document load() using a...
12
by: Stefano | last post by:
Hi all, what is the correct use of the "default" attribute in XML Schema? For example: <xs:element name="myProperty" type="xs:string" default="myDefaultValue"/> What can I do with it? What...
5
by: Neil Norfolk | last post by:
I am using C# in Visual Studio 2003. I would like to serialize a class that contains, amongst other things, public delegate void DocumentsPreferencesChange(object env, Documents e); public event...
7
by: Oisin Grehan | last post by:
Hi, I have a UserControl derived class: <ns:votingbutton runat="server" id="btn1" onclick="votingbuttonclick" /> My question is, what code do I need in place in the codebehind for this to...
5
by: Samuel R. Neff | last post by:
Is there a way to add the NonSerialized attribute to the "Event" fields that the VB.NET compiler creates when you declare an event? I have a class that we use with binary serialization and we...
0
by: Jaime Stuardo | last post by:
Hi all... I have the following curious problem, I have a GridView that I bind after I press a button in the web form. That grid has a template column, which contains a checkbox (in the header...
8
by: SL | last post by:
I try to validate against a schema a document stored in several files thanks to external entities. The parseur add a 'xml:base="url"' attribute on the root element of this sub-trees during parsing,...
1
by: Stedak | last post by:
We have a WinForm application that we would like to add security to. We would also like to set up a configuration utility that would make it easier to assign or remove rights. When using code...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.