foreach (ListItem li in DropDownList1.Items)
{
if (li.Text.ToUpper() == category.ToUpper())
{
li.Selected = true;
break;
}
}
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"netnatter" <(E-Mail Removed)> wrote in message
news:rJbuk.190467$(E-Mail Removed)2...
>I am getting a value from a textbox and checking its in a dropdown list
>then displaying it with taht position in the list selected
>
> All is well but it is case sensitve.
>
> Is there a work round to make it ignore case? ie if category="Front porch"
> and the user typed Front Porch or front porch
>
> e.g. DropDownList1.SelectedValue =
> DropDownList1.Items.FindByText(category).Value
>
>