CheckBocList values problem
- From: Gan Forr <hopewontdie@xxxxxxxxx>
- Date: Fri, 14 Mar 2008 03:32:36 -0700 (PDT)
Hi....I have a problem.
I created a CheckBoxList on a web form, but...when I populate it....in
the resulting Html page there is no value in every checkboxlist item.
I did something like this (suppose that I pass the CheckBoxList as
parameter):
private void
PopulateCheckBoxList(System.Web.UI.WebControls.CheckBoxList control)
{
control.Items.Clear();
for (int i=0; i<10; i++)
{
string Cod = "Value" + i.ToString();
string Text = "Text" + i.ToString();
ListItem item = new ListItem();
item.Text = Text;
item.Value = Cod;
item.Attributes.Add("value",Cod);
control.Items.Add(item);
//control.Items.Add(new System.Web.UI.WebControls.ListItem(Text,
Cod));
}
}
I noticed that the checked values are actually present when I get them
from the c# code, but I need to have them in the html page too. I
tried to add manually the "value" attribute as you can see but I
couldn't get the value in the web page.
I hope somebody can help me
Thanks
Federico
.
- Follow-Ups:
- Re: CheckBocList values problem
- From: Stan
- Re: CheckBocList values problem
- Prev by Date: Ajax MutuallyExclusiveCheckBoxExtender with CheckBoxList
- Next by Date: Re: CheckBocList values problem
- Previous by thread: Ajax MutuallyExclusiveCheckBoxExtender with CheckBoxList
- Next by thread: Re: CheckBocList values problem
- Index(es):
Relevant Pages
|