Not able to store the checkbox values in seperate rows

Jul 22 2016 3:02 AM
protected void Submit(object sender, EventArgs e)<br /> {<br /> var Trolley = txttrolley.Text;<br /> string Id = "";<br /> if (btnsubmit.Text == "Add")<br /> {<br /> <br /> Id = " 0";<br /> }<br /> else<br /> {<br /> Id = ViewState["ID"].ToString();<br /> }<br /> <br /> string Attribute = "";<br /> try<br /> {<br /><br /> foreach (ListItem item in DropDownCheckBoxes1.Items)<br /> {<br /> if (item.Selected)<br /> {<br /> Attribute += item.Value + ",";<br /> }<br /> }<br /> Attribute = Attribute.Remove(Attribute.Length - 1);<br /> }<br /> catch (Exception ex)<br /> {<br /><br /> }

Answers (3)