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 July 15th, 2003, 10:02 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP on Internet Vs. Intranet

Hi There,

I created an ASP form and ran it on my company's Intranet. Everything works fine. However, when I uploaded to the Internet, I got all kinds of error messages. I was able to fix a few but not all. Please help! What can I do to fix these problem? Below is one of the message. Why is it happening on my Internet server and not my Intranet? Thank YOU!!!

Response object error 'ASP 0156 : 80004005'
Header Error
/hr/LEON/WORKING ON/online_forms.asp, line 226
The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.


 
Old July 15th, 2003, 10:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This particular problem has occurred to me when I have tried to do a response.redirect part way in a page. Putting this at the top of your page should solve this problem:

Code:
<%Response.Buffer = True%>
Chris
 
Old July 15th, 2003, 03:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

The error most likely occurs in pages that write cookies or try to redirect somewhere in the content section of the page (after you have already outputted some content to the browser).

By design, you'll need to send the entire HTTP header information for a page to the browser before you send any content (including spaces etc). If you try to modify the header after you send some content, this error will occur.

There are two ways to overcome this problem:

1. Write cookies and redirect before you send content to the browser, like this:

Code:
<%
  ' business decisions here.
  'Cookies, redirects etc go here.
%>
<html>
This way, you'll avoid the problem by sending header info before content.

2. Like Chris mentioned, you can turn on buffering. It can be done on a page basis (like the example Chris showed) or on web server basis. (It's likely that your new server has turned this option off). To change it, open IIS, and then the Properties dialog of your website. On the Home Directory tab, click Configuration. Select Enable Buffering on the Options tab.

Personally, I think a mix of both solutions is the best way. Solution 1 is good because it forces you to pack all your business logic decisions together which makes your code easier to understand.

Solution 2 is good because buffering improves the performance of a ASP page (that's why it's on by default on IIS5+ webservers).

HtH

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.net with Dreamweaver MX for Intranet cJeffreywang ASP.NET 1.0 and 1.1 Basics 0 April 2nd, 2007 05:49 PM
Is ASP.NET used in Intranet or a Lan Application ! augustine General .NET 1 September 13th, 2004 08:24 AM
events module in Building an asp.net intranet nickm All Other Wrox Books 1 August 25th, 2004 01:07 PM
ASP.NET Intranet Problem (IBuySpy) uh6uj All Other Wrox Books 2 February 22nd, 2004 08:29 AM
Building an ASP.NET Intranet Chapter 7 Question MrGio All Other Wrox Books 1 November 20th, 2003 09:57 AM





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