PC Review


Reply
Thread Tools Rate Thread

case problem

 
 
netnatter
Guest
Posts: n/a
 
      30th Aug 2008
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


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      31st Aug 2008
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
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
translate VB select case to switch case problem Rich P Microsoft C# .NET 13 8th Aug 2009 06:07 PM
Case without Select Case error problem Ayo Microsoft Excel Misc 2 16th May 2008 03:48 PM
Can't find short cut for changing case ... upper case .... lower case JERRY Microsoft Word New Users 7 23rd Aug 2007 05:29 PM
CASE problem AkAlan via AccessMonster.com Microsoft Access ADP SQL Server 1 2nd Mar 2006 08:09 PM
Case Study: Dial-up Internet problem -- What is likely to be the problem? Midnight Moocher Computer Hardware 3 16th Apr 2004 02:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:30 AM.