Vasanth Jack

Vasanth Jack

  • NA
  • 289
  • 35.2k

The same value is repeat when we check more than one chkbox

Feb 1 2017 6:27 AM
When i check more than one check box it repeat the same value like below
 
when i clik 1 means it seems 1
 
when i click 1 and 2 means it seems 1,1,2 
 
 
 
string val = string.Empty;
StringBuilder sb = new StringBuilder();
foreach (ListItem it in cckk.Items)
{
if (it.Selected)
{
val += sb.Append(it.Value + ',');
ViewState["vallue"] = val.Remove(val.Length - 1).ToString();

}
}
string a1a = Convert.ToString(ViewState["vallue"]);
}
 

Answers (1)