In ASP.NET/C# how to check if the listbox has a duplicate value before entering a value from textbox.
I tried
If(ListBox1.Items.Contains(TextBox1.Text))
{
// do nothing
}
else
{
ListBox1.Items.Add(TextBox1.Text);
}
I am getting error at first line.
I think you can do something like this