Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional 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
 
Old August 31st, 2004, 06:21 AM
Authorized User
 
Join Date: Apr 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default why not index.asp?id=1 can be www.myweb.com/?id=1

Hi

i have encounter a problem.

It is working properly:
www.myweb.com/index.asp?id=1

but it is not:
www.myweb.com/?id=1

how to do the second one. I also see in many websites that r using the second one line.

Thanks
Burhan



 
Old August 31st, 2004, 07:15 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

for this, you have to make index.asp as the first default document in the IIS settings.

Open IIS manager.
Rightclick virtual folder and select properties.
Click documents tab.
Add index.asp to default documents list if it is not already there.
Move index.asp up until it becomes the first default document.
save and restart www service.
 
Old August 31st, 2004, 08:11 AM
Authorized User
 
Join Date: Apr 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks madhukp.

Bur problem is that index.asp is already my default page.

when i open this:
localhost/myweb
then it open index.asp

but not doing this:
localhost/myweb/?id=1

what is mistake

thanks
Burhan

 
Old August 31st, 2004, 08:55 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

In the IIS settings, you can have more than one default page in a pre-defined order. For e.g. The default pages may be

default.htm
default.asp
index.htm
index.asp

in that order. Then it will first look for a page default.htm. If it is not available, it will look for default.asp. On the other hand, if it is available, it will show default.htm. Like that it will check for a max of 4 files. If none of above files are there in the folder and if the directory listing is not permitted, it will give a 403 error. (If directory listing is permitted, it will list all files of the directory).

The order of the files in the above list is important for your requirement. That is why I asked you to push index.asp to the top in the list.

[u]Otherwise, you can delete default.htm, default.asp and index.htm files from the folder. This may not be possible if you are using them for some purposes.</u>

Please follow the steps above fully. You may require the help of server admin incase you are using a remote server.
 
Old August 31st, 2004, 12:13 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

I didn't know you can do:

/?id=1

I thought it would interpret that incorrectly. Is that wrong?

Brian
 
Old August 31st, 2004, 09:17 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

hi,

  Madhu is correct. I tried its working by giving the index.asp as my default page in my website properties.

http://servername/virtualfolderaliasname/?id=1

But you must have index.asp in your folder.

its working fine.

 
Old August 31st, 2004, 11:18 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

This feature was there from IIS 5.0 onwards. If pagename is missing, it will assume the querystrings are sent to the default page of the directory.
 
Old September 2nd, 2004, 06:53 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

But does that work only for the ROOT of the website or for its subfolders too?

_________________________
- Vijay G
Strive for Perfection
 
Old September 2nd, 2004, 11:34 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

This will work for all sub-folders also.
 
Old September 3rd, 2004, 01:10 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

AFAIK, the client determines the next page to request.

When a browser requests a folder, a list of "default document" is then returned to the client together with one of the HTTP error codes indicating a folder was requested. The client tries to request the first document, and then the next if the first didn't exist and so on.

So /?id=1 would actually end up as Default.asp?id=1 once the browser has requested the page.

I could be completely wrong about this, so don't take my word on this, but this is how I think it works.....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP Add New Record and Get ID omninewt Classic ASP Databases 5 April 10th, 2008 12:20 PM
Passing asp control id to javascript jazzcatone ASP.NET 1.0 and 1.1 Professional 0 October 18th, 2006 01:38 PM
'this.ID = id;' in class construction holf BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 October 6th, 2006 10:58 AM
Get the Id of Control in ASP rekha_jsr Classic ASP Professional 2 June 14th, 2006 07:37 AM
ASP Insert - Get Record ID llowe Classic ASP Databases 2 March 24th, 2004 11:11 AM





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