Hi Vasanth057,
I have created sample. Refer the below code.
HTML
<asp:ListBox runat="server" ID="chkCuisieType" SelectionMode="Multiple">
<asp:ListItem Text="American" />
<asp:ListItem Text="Indian" />
<asp:ListItem Text="African" />
</asp:ListBox>
<br />
<asp:Button Text="Get" runat="server" OnClick="Get" />
C#
protected void Get(object sender, EventArgs e)
{
string[] CusineType;
ArrayList cblSelections = new ArrayList();
foreach (ListItem item in chkCuisieType.Items)
{
if (item.Selected)
{
cblSelections.Add(item.Text);
}
}
CusineType = (string[])cblSelections.ToArray(typeof(string));
string CusineValue = string.Join(",", CusineType);
CusineValue = "'\"" + CusineValue.Replace(",", "\",\"") + "\"'";
Response.Write(CusineValue);
}
Screenshot
