Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 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 January 4th, 2007, 07:33 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default object required Request

hi guys i am having this error generated from this code
<html>
<head>
<SCRIPT LANGUAGE="VBScript">

dim ReturnUrl
ReturnUrl=request.ServerVariables("HTTP_REFERER")
</SCRIPT>

</head>
<body>
<p align=center>
<b>"An error has occured! Sorry for the inconvenience ..." </b>
    <br><br>
    <a href="<%=ReturnUrl%>"> Return To Page </a>
</p>
</body>
</html>

Object required:Request
Now i know that i used the request object in a client-side script. The client does not have any notion of the ASP environment so
what i am truying to do cannot be done in this manner. All i want is to create an error page for my asp.net website..i mean when an error occurs it goes to this page error.html,shows the message An error has occured! Sorry for the inconvenience ..." and then offer the user a link to go back to were he was which can be handeled by request.servervariables("HTTP_REFERER").I got stuck on my method and cant find any other way.Ur Help is appreciated.10x

 
Old January 4th, 2007, 09:05 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi RoniR!!
Two ways to do samething
**********test1.asp**********
<html>
<head>
</head>
<body>
<SCRIPT LANGUAGE="VBScript" runat="server">

dim ReturnUrl
ReturnUrl=request.ServerVariables("HTTP_REFERER")

response.write("<p align=center>")
response.write("<b>""An error has occured! Sorry for the inconvenience ..."" </b><br><br>")
response.write("<a href='"&ReturnUrl&"'> Return To Page </a>")
response.write("</p>")
</SCRIPT>
</body>
</html>
***************test2.asp*************
<html>
<head>
<%
  dim ReturnUrl

ReturnUrl=request.ServerVariables("HTTP_REFERER")
%>
</head>

<body>
<p align=center>
<b>"An error has occured! Sorry for the inconvenience ..." </b>
    <br><br>
    <a href="<%=ReturnUrl%>"> Return To Page </a>
</p>
</body>
</html>
***************
Note:-
In first method you only need to specify runat=server so that ur script will run on the server,since on the client side (when u use <SCRIPT LANGUAGE="VBScript">) ,there is no request object ,that browser can understand.

hope this will help you




Cheers :)

vinod
 
Old January 5th, 2007, 02:53 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey thanks for the reply..Your first method didnt work i still got the same error. The second one worked fine .I just cant seem to be able to fill the variable ReturnUrl with the value of Request.ServerVariables("HTTP_REFERER") in the <a href="<%=ReturnUrl%>"> Return To Page </a>
ur help is appreciated.10x

 
Old January 8th, 2007, 06:53 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii RoniR!!

Request.ServerVariables("HTTP_REFERER") is used with <a href> tag,and sometimes it gives null value to..

these links will help you
http://www.sitepoint.com/forums/showthread.php?t=310184
http://www.velocityreviews.com/forum...tpreferer.html

Cheers :)

vinod




Similar Threads
Thread Thread Starter Forum Replies Last Post
Object required jpaul VB Databases Basics 5 November 14th, 2007 12:10 PM
object required alitoday Classic ASP Components 1 December 28th, 2004 01:17 AM
object required shoakat Classic ASP Databases 7 November 23rd, 2004 07:38 PM
error....Object required: '' sassenach Classic ASP Databases 2 August 4th, 2003 03:27 PM





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