Case issue with ASP <%=Request("")%> code

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I have an ASP page that lists projects by type. The code
at the top of the page lists which type of project it is
using <%=Request("projType")%> item.

Strange thing is that when the page displays, the project
type is in lower case "housing". The projType list in the
database is in sentence case as in "Housing", but on the
page it comes up in lower case. I need it to display in
Sentence case.

What could be causing this?

-M
 
If the data was place in the database directly via Access Forms and then Access Forms is use to
display it, then Access is controlling this. On the web with ASP/VBScript, you are seeing the
content as it is actually stored in the database.

Maybe someone known a script that does Sentence case, but in general I VBScript support lowercase
and uppercase directly and I have code the allow Proper case, but I have never seen code for
Sentence case, so this would be something you would have to write or find someone to write OR place
the content into the database directly in the format you want it to be displayed.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
You might also try accessing the correction more directly. Just saying
Request("fieldname") is an expensive operation actually because it has to go
through all the collections, Form, QueryString, and ServerVariables. The
ServerVariables collection is extremely slow as it has to ask the server for
all these variables. See if doing Request.QueryString("fieldname") (if using
the Get method) or Request.Form("fieldname") (if using the POST method) may
make a difference. It may just be that searching through all the collections
for a matching key is messing it up. You may also try posting in the
microsoft.public.inetserver.asp.general newsgroup as well.

Hope this helps
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
Hi Thomas,

No special script is required use StrConv(string expression, vbProperCase)
 
I can't see all of the code for your page, but I suspect that you have a
drop-down selector on the previous page with <select name="projTyp"> ... ??

If that is true, then I suspect that the reason you are seeing "housing"
instead of the DB version "Housing" is because "housing" is the value
assigned to that option in the drop-down code.

<option value="housing">Housing</option>

Would LOOK like you are selecting "Housing" but the value sent to the post
processing page is "housing".

Either change the <option ... > code or present the DB version rs("Field")
instead of Request("projType") on the results page.

Again, I made some assumptions here but hope this helps.

Richard Weerts
 
Mike,

Thanks for that, I have always used a script to accomplish this. The MS VBScript Language Reference
doesn't contain any references for displaying text in ProperCase format.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
The drop down is from the database. The database table
contains the word Housing. I would suspect then that it
should return "Housing", not housing.

-M
 
Are you viewing the data in Access in table view?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top