Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > BOOK: Beginning ASP 3.0
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 7th, 2006, 11:03 PM
Registered User
 
Join Date: May 2006
Location: London, , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 7, Request.QueryString problem

Hi, I'm quite new to programming, and I can't figure out the solution for this problem.
I have tried the examples on chapter 7 of the book (page 255) about the request and response objects.
the Request.QueryString.htm page will display normally, but, when I click the "submit" button, I get this message on the browser:

Holiday Response Form
Apache Active Scripting Runtime Error

Object required: 'Request.QueryString(...)'

Line #9, Char #3

When I got absolutely desperate trying to find out how to repair it, without success, I deleted the files and used instead teh ones downloadable from the book's downloads page, and i got exactly the same result.
Am I doing anything wrong?
Or is the fact that I'm using an Apache web server what is causing the problem?

Thank you very much in advance for your help.
Paco.
  #2 (permalink)  
Old May 19th, 2006, 12:32 PM
Registered User
 
Join Date: May 2006
Location: London, , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, this is a self-reply to my own question, but I'm going to post it because I think it may be useful to someone facing the same problem, or someone may find a way to improve it.
I have reached a partial solution to the problem, and I think that this is caused by how the Apache server handles ASP objects.
The problem was that if I typed Request.QueryString("HolidayLocation").Count=0 the server would send the message
Apache Active Scripting Runtime Error

Object required: 'Request.QueryString(...)'

Line #11, Char #2
But if I typed Request.QueryString.Count=0, then the answer changed. If I selected one city, it would give me the correct output, such as
We will send you details on Rome as requested.
If I selected more than one city, it would only "read" the first of them. For example, if I selected Madrid and Paris, the output would be
We will send you details on Madrid as requested, and If I didn't select any city, instead of the expected output, which should be
"We won't send you any details " I got this
We will send you details on as requested.
I could therefore select one city and get the correct output, but if I selected more than one or none at all the output would be somehow wrong.
The next thing I tried was to create a variable, strLocation, and give it the value of Request.QueryString("HolidayLocation") I then changed the code to look like this;
<%
  Dim strLocation
    strLocation = Request.QueryString("HolidayLocation")
    If strLocation = "" then
      Response.Write "We won't send you any details"
    Else
    Response.Write "We will send you details on "
    Response.Write Request.QueryString("HolidayLocation")
  End If
%>
 as requested.
By doing this, I could still only select one city, if I selected two or more, only the first would be recognised, but if I didn't select any city I would now get the correct output.
I guess I could mask the inconvenience by modifying the code in a way that only allow the user to select one city at a time, but that, of course, is not the objective of the exercise.
I would welcome any help on this, and also any insight on how Apache or any other server handles VBscript and ASP.
Thank you,
Paco.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Request.Form / Request.QueryString Toran Classic ASP Databases 4 January 17th, 2007 02:23 PM
Request.Querystring ms_code_bsuter ASP.NET 1.0 and 1.1 Basics 1 February 10th, 2006 08:10 PM
Problem with Request.QueryString mg1966 Classic ASP Databases 4 January 7th, 2005 02:04 PM
request querystring dannyphw ASP.NET 1.0 and 1.1 Basics 1 October 25th, 2004 10:35 AM
request.querystring() , request.form() alyeng2000 ASP.NET 1.0 and 1.1 Basics 1 December 30th, 2003 12:07 AM



All times are GMT -4. The time now is 08:50 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.