Can't use attributes.add for checkbox?

  • Thread starter Thread starter Paul W
  • Start date Start date
P

Paul W

Hi -

Why does this code:

Dim mychk As New CheckBox
mychk.Attributes.Add("Resid", "R" & 123213)
mychk.ID = "chk3"

render as this:

<span Resid="R123213"><input id="chk3" type="checkbox" name="chk3" /></span>

instead of this:

<input Resid="R123213" id="chk3" type="checkbox" name="chk3" />

If I use a textbox, instead of a checkbox then I get a version of the second
html, as desired.

Thanks, Paul.
 
Hi -

Why does this code:

Dim mychk As New CheckBox
mychk.Attributes.Add("Resid", "R" & 123213)
mychk.ID = "chk3"

render as this:

<span Resid="R123213"><input id="chk3" type="checkbox" name="chk3" /></span>

instead of this:

<input Resid="R123213" id="chk3" type="checkbox" name="chk3" />

If I use a textbox, instead of a checkbox then I get a version of the second
html, as desired.

Thanks, Paul.
I presume that the MS team is doing this to allow for checkbox lists!
 
Thanks - using the "Onclick" works ok, but using "name" still creates a
<Span>. Guess I'll have to find an obsure 'real' attribute to use - any
suggestions?

Paul.
 

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

Back
Top