Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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

  #2 (permalink)  
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
  #3 (permalink)  
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

  #4 (permalink)  
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
 


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
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



All times are GMT -4. The time now is 02:15 AM.


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