Default.aspx
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:CheckBoxList ID="CheckBoxList1" runat="server">
<asp:ListItem>Swaminarayan-BAPS</asp:ListItem>
<asp:ListItem>Microsoft</asp:ListItem>
<asp:ListItem>Apple</asp:ListItem>
<asp:ListItem>Oracle</asp:ListItem>
<asp:ListItem>IBM</asp:ListItem>
</asp:CheckBoxList>
</div>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<p>
<asp:TextBox ID="TextBox1" runat="server" Height="165px" TextMode="MultiLine"
Width="242px"></asp:TextBox>
</p>
</form>
</body>
</html>
==========================================================================
Default.aspx.cs
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Text ="";
foreach(ListItem lst in CheckBoxList1.Items)
{
if(lst.Selected==true)
TextBox1.Text += lst.Text + "\n";
}
}
}
Now simply make change or add another contidtion with the if() & modify.It's so easy now