473,395 Members | 1,526 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,395 software developers and data experts.

Can't use attributes.add for checkbox?

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.
Nov 19 '05 #1
3 2982
did u try adding it to a Known attribute like onClick??

mychk.Attributes.Add("OnClick", "R" & 123213)

--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
---_,>/'_------
(_) \(_)
---------------
"Paul W" wrote:
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.

Nov 19 '05 #2
On Fri, 08 Jul 2005 12:38:44 -0400, Paul W wrote:
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!

Nov 19 '05 #3
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.

"vinay" <vi***@discussions.microsoft.com> wrote in message
news:83**********************************@microsof t.com...
did u try adding it to a Known attribute like onClick??

mychk.Attributes.Add("OnClick", "R" & 123213)

--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
---_,>/'_------
(_) \(_)
---------------
"Paul W" wrote:
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.

Nov 19 '05 #4

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

Similar topics

0
by: Tony | last post by:
I have a repeater that renders multiple checkboxlists that are set up with a repeat direction of horizontal. Because the labels for each checkbox are different in length only the individual...
1
by: Liu Xuesong | last post by:
I want to add Attributes into CheckBox in .aspx page <html> <asp:CheckBox id="ChapterCheck" runat="server" /> </html> How to add Attributes in <asp:CheckBox> ?
1
by: dx | last post by:
I'm extremely frustrated with ASP.NET...again! To me this should be as simple as setting oCheckBox.Checked = True.. yet for some reason it isn't. I have a user control (ascx) that that has a...
1
by: Sanjay Pais | last post by:
I built a custom control for all the basic web.ui.controls like textbox, label, checkbox etc etc. I added my custom attribute called ApplySecurity to the html in the page. However, when I cycle...
1
by: John Dalberg | last post by:
I am trying to center a checkbox in a datagrid column but the checkbox always displays to the right. Below is the rendered html. I also used a css-class with the same text-align: center attribute....
4
by: Richard Walker | last post by:
Hi I'm trying to disable/enable a group of checkboxes using javascript, but can't work out how to refer to them. eg: <form name="selectform" action="data.php" method="post"> <input...
3
by: macsaregreat | last post by:
How do you apply 2 onclick events to a check box. I googled this and found multiple ways of doing it, but they dont work. Maybe i was not using the correct syntax, but i cant figure it out. these...
1
by: ahmad fathy | last post by:
I'd like to know if there is some way to get document elements by their attributes not just by their names like the following : document.getElementsByTagName("input") as the previous function will...
1
by: mark4asp | last post by:
Here is the control: <asp:CheckBox ID="chkLite" runat="server" Checked="False" AutoPostBack="True" OnCheckedChanged="chkLite_CheckedChanged" /> Here is the code-behind: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.