Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 May 21st, 2005, 09:17 PM
Registered User
 
Join Date: May 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error Received When Trying to Get Location.Href

<% Response.Write( Location.Href ) %>

This is the only code and I am getting this error:

Microsoft VBScript runtime error '800a01a8'

Object required: ''


 
Old May 22nd, 2005, 06:19 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

That code is invalid. What are you trying to achieve with this code?

I assume you are trying to access information held in server variables, EG <%= request.servervariables("script_name") %> Ask Google about server variables.

FYI: If you were using <% Option Explicit %> in the head of all your ASP pages you would get a different and much more friendly error:
"Variable is undefined: 'Location'"




Wind is your friend
Matt
 
Old May 22nd, 2005, 09:48 PM
Registered User
 
Join Date: May 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am trying to pull out part of the URL so that I can use it in an If statement.

A chain is only as strong as its weakest link - You.
 
Old May 22nd, 2005, 09:54 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

The following will give you Eg /DirName/pageName.asp
<%= request.servervariables("PATH_INFO") %>

If that not what you are after go to:
http://www.lib.washington.edu/asp/browser/servar.asp
Look at the examples and replace PATH_INFO with the name that gives you the result you want.



Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 8, href and HRef (p. 285) roman BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 June 16th, 2008 10:40 AM
document.location.href surendran Javascript 5 August 3rd, 2005 10:17 PM
error HREF=$PHP_SELF?action broccolo PHP Databases 5 December 26th, 2004 10:07 AM





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