CssClass property not working

D

Dales

In a composite control, here's my CreateChildControls Sub-Procedure...

Protected Overrides Sub CreateChildControls()
Me.Controls.Clear()
_txtDate = New TextBox
_txtDate.ID = _txtDate.ClientID
_txtDate.CssClass = "FormElementEnabled"
_txtDate.Text = _txtInitialValue
_txtDate.MaxLength = 10
_txtDate.Attributes.Add("size", "11")
Me.Controls.Add(_txtDate)
End Sub

When my control renders on the page, here's what the class attribute
comes out looking like (notice the &quot's and the redundant
"class="):

<input name="Date1:_ctl0" type="text" value="mm/dd/yyyy"
maxlength="10" class="class=&quot;FormElementEnabled&quot;" size="11"
/>

Does anyone have any idea why CssClass is not working? Why should I
have to use the Attributes collection to add a value to the class
attribute when CssClass should do it for me? I haven't seen this
problem before.

Any ideas?
 
D

Dales

Never mind. I had a logic error and some code left over from
converting this from a standard VBScript class.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top