homepage Welcome to WebmasterWorld Guest from 54.227.41.242
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
classic asp case select not case sensitive
aps case select
malinkam




msg:4416842
 9:58 pm on Feb 12, 2012 (gmt 0)

On one of our forms we use following:

myfilter = Request.Form("x_name")
myfilter = left(myfilter,5)
select case myfilter
CASE "pharm"
Response.Redirect "TESTERROR.asp"
end select

this works just fine, if word "pharm" is found it redirects user to TESTERROR.asp

But this is case sensitive and for example word "Pharm" will not get caught and it will pass through the form. How would we re-write this to work and not be case sensitive.

 

dstiles




msg:4416847
 11:08 pm on Feb 12, 2012 (gmt 0)

Always has been case-sensitive - almost all tests are with the exception of the extended text comparison.

Use LCase(string) to lower case it (UCase for upper case).

It's a real pain, I agree - adds a lot more extra code on longer scripts and makes for strange debug errors. It would have been useful if there had been (eg) an AlwaysMakeCaseLower switch.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved