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 October 20th, 2004, 11:05 AM
Authorized User
 
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default HTTP 405 error

hi i'm trying to call a html page from an asp page which
prints its contents, but i keep getting this error,
The page cannot be displayed:
HTTP 405 Resource not allowed


any ideas anyone?
Thanks
Treasa


 
Old October 20th, 2004, 11:29 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Can you post some code that is involved in this?

_________________________
- Vijay G
Strive for Perfection
 
Old October 20th, 2004, 11:54 AM
Authorized User
 
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sure, the .asp code thats calling the page is:
<form method = post action="printpage.html" target="_blank">
<input type="submit" value="Print Page" name="PrintPage" style="float: left"></td>
</form>

The other page is just a page i got from the internet and it is as follows... the only problem is that if i just type in the address of this page it works no problem, it just can't be called from the asp page for some reason.

<HTML>
<BODY onload="doPrint()">
<object id="WBControl" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>

<script language="VBScript"><!--
Sub VBPrint() On Error Resume Next
  WBControl.ExecWB 6,1
End Sub
//--></script>

<script language=JavaScript><!--


function doPrint()
{
    if(self.print)
    {
        self.print();
        self.close();
        return false;

    }
    else if (navigator.appName.indexOf('Microsoft') != -1)
    {
        VBPrint();
        self.close();
    }
    else
    {
    alert("To print this document, you will need to\nclick the Right Mouse Button and select\n'Print'");
    }
}
//-->
</script>

<P>
Me<br>
<IMG src="http://www.aspalliance.com/chrisg/tools/image2.aspx#63;src=/chrisg/tools/test.gif&amp;width=200&amp;height=200"><p>

<p>
Tigger<br>
<IMG src="http://www.aspalliance.com/chrisg/tools/image2.aspx#63;src=/chrisg/tools/tigger.jpg&amp;width=250&amp;height=200">

<h1>This page will now show the print dialog</h1>
... please wait
</BODY>
</HTML>

thanks!

 
Old October 20th, 2004, 12:19 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Treasa,

Not sure why it doesn't work when you do a FORM POST. It works fine with GET method and when used with <a href...>
Code:
<form method="get" action="printpage.html" target="_blank"> 
<input type="submit" value="Print Page" name="PrintPage" style="float: left"></td>
</form>

<a href="Printpage.html">Print Page</a>
Both these codes are working fine.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old October 21st, 2004, 03:04 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Treasa,

Is it an IIS web server? If so, posts to .htm & .html pages will return a 405 unless you map the file extensions to a script engine. The page should work fine if you change it's extension to .asp

The following article may be of use http://www.somacon.com/docs/iis_http...wed_error.html

HTH,

Chris

 
Old October 21st, 2004, 03:43 AM
Authorized User
 
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks guys! its working fine now!






Similar Threads
Thread Thread Starter Forum Replies Last Post
What is HTTP 403 error exstream ASP.NET 2.0 Professional 1 April 28th, 2006 09:19 PM
Error HTTP 405 - Resource not allowed shefali Classic ASP Basics 2 February 20th, 2006 06:47 PM
error HTTP 405 - Resource not allowed hastikeyvan Dreamweaver (all versions) 1 January 12th, 2006 12:11 PM
status 405: Method not found viges VB.NET 2002/2003 Basics 1 May 18th, 2004 12:53 PM
HTTP Status 405 - HTTP method GET .... nsakic Servlets 1 January 25th, 2004 04:50 PM





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