Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. string name = "";
  2. int counter = 0;
  3.  
  4. //new cookie object created for Q2 with checkboxlist1 for selecting ans
  5.  
  6. HttpCookie ans2 = new HttpCookie("cbl1");
  7. string mstr = "";
  8. foreach (ListItem li in CheckBoxList1.Items)
  9. {
  10. if (li.Selected)
  11. {
  12. counter += 1;
  13. mstr = mstr + counter.ToString();
  14. name = li.Text;
  15. ans2.Values.Add(mstr, name);
  16. }
  17. }
  18. Response.Cookies.Add(ans2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement