473,396 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

case problem

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
Aug 30 '08 #1
2 1130
"netnatter" <ne*******@ntlworld.comwrote in message
news:rJ*********************@newsfe15.ams2...
>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?
GIYF:
http://www.google.co.uk/search?sourc...Text+sensitive

The first hit (http://forums.asp.net/t/1269942.aspx) in the above search
looks pretty useful...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 30 '08 #2
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" <ne*******@ntlworld.comwrote in message
news:rJ*********************@newsfe15.ams2...
>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


Aug 31 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ryan | last post by:
I'm struggling with a Case statement. The problem I has is with doing >= I can use any value in there, but need to check if it's greater or equal to 1. I'm sure I'm missing something but can't...
1
by: richasaraf | last post by:
Hello everyone, I'm facing problem in converting CASE statements into DECODE. As i have PL/SQL 8i, so it does not handle CASE statements. Please send me the solutions . Then basic problem is the...
0
by: richasaraf | last post by:
Hello everyone, Please HELP !!!!! I'm facing problem in converting CASE statements into DECODE. As i have PL/SQL 8i, so it does not handle CASE statements. Please send me the solutions . Then...
10
by: MLH | last post by:
Suppose the following... Dim A as Date A=#7/24/2005# I wish to compare value of A against 2 other values: 1) 8/1/2005 2) 9/1/2005 Which is better and why... First:
29
by: SysSpider | last post by:
Hi again, This is my problem: when i try to compile the code that contains the function below, i get this: -- gcc:21: error: case label does not reduce to an integer constant gcc:24: error:...
10
by: Chih-Hsu Yen | last post by:
I encountered a strange problem about switch-case statement. switch(cmd) { case 1: statements; break; case 2: statements; break; ... .... case 11: S1; S2; S3; statements;
4
by: jimdscudder | last post by:
I am using a file watcher to watch for files changing. My problem is: the string file info returned is all LOWER CASE. Below is the important part of the code? Any suggestions? using...
8
by: Chris Noble | last post by:
I need to check whether a particular user is already a member of an Active Directory Security Group. The following code extract works but only if the user distinguished name is exactly the same...
9
by: Robbie Hatley | last post by:
Greetings, group. I just found a weird problem in a program where a variable declared in a {block} after a "case" keyword was being treated as having value 0 even though its actual value should...
11
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.