A
Andreas Bauer
Hi,
when the page loads I want to add items to a checkboxlist.
CheckBoxList cbprofiles = new CheckBoxList();
foreach (ProfileService.ProfileType p in profiles)
{
cbprofiles.Items.Add(new ListItem(p.name, p.id.ToString()));
}
ProfilesPlaceHolder.Controls.Add(cbprofiles);
p.id.ToString are normal integers. But when I look at the source code I
get this strange id values:
<tr>
<td><input id="ctl00_ContentPlaceHolder1_ctl00_0" type="checkbox"
name="ctl00$ContentPlaceHolder1$ctl00$0" /><label
for="ctl00_ContentPlaceHolder1_ctl00_0">Text1</label></td>
</tr><tr>
<td><input id="ctl00_ContentPlaceHolder1_ctl00_1" type="checkbox"
name="ctl00$ContentPlaceHolder1$ctl00$1" /><label
for="ctl00_ContentPlaceHolder1_ctl00_1">Text2</label></td>
</tr>
You could please explain this to me?
Best regards,
Andi
when the page loads I want to add items to a checkboxlist.
CheckBoxList cbprofiles = new CheckBoxList();
foreach (ProfileService.ProfileType p in profiles)
{
cbprofiles.Items.Add(new ListItem(p.name, p.id.ToString()));
}
ProfilesPlaceHolder.Controls.Add(cbprofiles);
p.id.ToString are normal integers. But when I look at the source code I
get this strange id values:
<tr>
<td><input id="ctl00_ContentPlaceHolder1_ctl00_0" type="checkbox"
name="ctl00$ContentPlaceHolder1$ctl00$0" /><label
for="ctl00_ContentPlaceHolder1_ctl00_0">Text1</label></td>
</tr><tr>
<td><input id="ctl00_ContentPlaceHolder1_ctl00_1" type="checkbox"
name="ctl00$ContentPlaceHolder1$ctl00$1" /><label
for="ctl00_ContentPlaceHolder1_ctl00_1">Text2</label></td>
</tr>
You could please explain this to me?
Best regards,
Andi