Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 19th, 2003, 07:43 AM
Authorized User
 
Join Date: Jun 2003
Location: St-Laurent, Quebec, Canada.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default "Page cannot be displayed"

Hello,

I have a web page which automatically refresh itself and redirect to another page for 30 sec and then refresh and redirect back to the main page and the cycle begins again after 3 minutes on the main page.

The page that gets redirected to is our Intranet home page and sometimes it's down and so I get this "Page cannot be displayed" on the screen.

Is there a way to find out, after loading a page, whether it failed or not?

The redirect is between two .asp pages.
Thank you

A.Delcy
Web Administrator
Canada
__________________
A.Delcy
Developer
Canada
Reply With Quote
  #2 (permalink)  
Old June 19th, 2003, 09:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

You can force your browser to display more particular error message than "Page cannot be displayed". Go to Tools/Internet Options/Advanced and uncheck "Show friendly HTTP eroor messages". Then you'll see developer friendly error message on the page.

...but the Soon is eclipsed by the Moon
Reply With Quote
  #3 (permalink)  
Old June 19th, 2003, 10:02 AM
Authorized User
 
Join Date: Jun 2003
Location: St-Laurent, Quebec, Canada.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for your reply.

I guess my point is more towards finding a way to do something if case I get this "Page cannot be displed".

I don't really want to know the actuall error but rather do something in case it happens.

Page 1 is refresh and redirect to Page 2. In 30 seconds, Page 2 now refresh and redirect to back to Page 1.

My problem is that sometimes, Page 2 does not can display, so when it happens that Page 2 does not can display, I want Page 1 to know about it and therefore redirect to dummyRedirect page which redirect right back to the Page 1.

In .aspx project I did it in the web config file but .asp project doen't have the web config file.

Thank you


A.Delcy
Web Administrator
Canada
Reply With Quote
  #4 (permalink)  
Old June 19th, 2003, 11:35 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

You can use this function to check the status of the page 2 before the redirection:

Code:
Function CheckPageStatus(PageToCheck)
    Dim objXMLHTTP
    dim StatusOK
    set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP") 
    objXMLHTTP.Open "GET", PageToCheck, false
    objXMLHTTP.Send
    if objXMLHTTP.status=200 then
        StatusOK=1
    else
        StatusOK=0
    End If
    CheckPageStatus=StatusOK
    Set objXMLHTTP= Nothing
End Function


...but the Soon is eclipsed by the Moon
Reply With Quote
  #5 (permalink)  
Old June 20th, 2003, 07:59 AM
Authorized User
 
Join Date: Jun 2003
Location: St-Laurent, Quebec, Canada.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks alot for the help.

I will try that and I also would call the Intranet page from within a frame. So, Page 2 will be a page with a frame and the frame will load the Intranet page. I will use your function to test if the Intranet page is ok then do nothing else I will redirect back to page 1.

Thank you



A.Delcy
Web Administrator
Canada
Reply With Quote
  #6 (permalink)  
Old June 20th, 2003, 09:42 AM
Authorized User
 
Join Date: Jun 2003
Location: St-Laurent, Quebec, Canada.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,

I have tried the code that you have sent me and I found that the function always return the status code 404.

Please try the following code and let me know if it works.

I am running it from InterDev, right clicking and selecting browse.

Thank you


-----Code Start

<%
Function CheckPageStatus(strPage)
    Dim objXMLHTTP
    dim StatusOK
    set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
    objXMLHTTP.Open "GET", strPage, false
    objXMLHTTP.Send
    'if objXMLHTTP.status=200 then
        StatusOK = objXMLHTTP.status
    'else
    ' StatusOK=0
    'End If
    CheckPageStatus=StatusOK
    Set objXMLHTTP= Nothing
End Function
%>

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>

<%
intReturn = CheckPageStatus("http://insidewyeth.com/waci")
if intReturn = 0 then %>
<IFRAME ID=IFrame1 FRAMEBORDER=1 SCROLLING=NO width="100%" height="99%" SRC="PageFailed.asp"></IFRAME>
<%else%>
<IFRAME ID=IFrame1 FRAMEBORDER=1 SCROLLING=NO width="100%" height="99%" SRC="HTML Page1.htm"></IFRAME>
<%end if%>
<br> This is the number returned :
<%=intReturn%>

</BODY>
</HTML>

----Code ends

A.Delcy
Web Administrator
Canada
Reply With Quote
  #7 (permalink)  
Old June 22nd, 2003, 02:58 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Maybe you can try with ServerXMLHTTP object rather thatn XMLHTTP object.
(set objXMLHTTP = Server.CreateObject("MSXML2.Serverxmlhttp") instead of set objXMLHTTP = Server.CreateObject("Microsoft.xmlhttp") in the function body)

In order to work properly ServerXMLHTTP's proxy settings has to be configured using the proxycfg.exe tool. For more info -http://support.microsoft.com/support/kb/articles/Q289/4/81.ASP.

HTH.

...but the Soon is eclipsed by the Moon
Reply With Quote
Reply


Thread Tools
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
Page cannot be displayed. Voltron ASP.NET 2.0 Basics 0 October 22nd, 2006 04:20 PM
Why is it that the page cannot be displayed? gilgalbiblewheel Classic ASP Databases 2 April 10th, 2005 08:17 AM
The page cannot be displayed malachany Dreamweaver (all versions) 10 December 12th, 2004 01:36 PM
the page cannot be displayed aspweb BOOK: Beginning ASP.NET 1.0 1 October 20th, 2003 07:41 PM



All times are GMT -4. The time now is 06:50 AM.


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