By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,533 Members | 1,497 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,533 IT Pros & Developers. It's quick & easy.

response.redirect- problem in asp

P: 11
heya all, ive got abit of a problem. Im doin a system in asp- which works on a test server- but when on moving my application to a development server- it throws the following error messages where I do Response.Redirect:
//messages begin----------------------------
Response object error 'ASP 0156:80004005'
Header Error
/Catloguesearch2.asp, line 18
The HTTP headers are already written to the client
browser. Any HTTP header modifications must be made before
writing page content.
//messages end------------------------------

Ive already looked at the same post on this site- which coincidentally has the same problem but ive tried the soltion of looking at my include file as well as the set up on the other server.

This is urgent, so any help will be very much appreciated.

Thanks
Dec 4 '06 #1
Share this Question
Share on Google+
3 Replies


P: 65
Hi Frnd,

Plz send the coding then only we can solve it ...



Regards

(M. Nedu . . .)
Dec 4 '06 #2

P: 11
well- ive got a search page- which consits of a text box and a submit button- in a formwhich posts whatevers in the text box to this catalogue search.asp page.

starting from my catalgoue page-


Expand|Select|Wrap|Line Numbers
  1. <%@ language = "vbscript" %>
  2. <% option explicit %>
  3. <!-- Catalogue-->
  4.  
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  7. <%    
  8.   'This will be used for the page title and Header.
  9.   pageName = "Catalogue Results"    
  10.  
  11.   'Variables
  12.   dim CatCode, val1
  13.   CatCode = request("Catalogue Code") 
  14.  
  15.   If( CatCode = "" ) Then
  16.   response.redirect("Error page.asp")   'Please enter a value before clicking submit!
  17.   Else
  18.   End If 
  19. %>
  20.  
  21. <body>
  22. <!--#include file="Header.asp"-->
  23. <tr><td>&nbsp;</td></tr>

Please note ive only inclueded the part of the code where the error is pointing to.



the header code is- which im including in the catalogue code is:

Expand|Select|Wrap|Line Numbers
  1. <head>
  2. <%
  3.   dim folderDepth, backUrl, pageName
  4.   'example: folderDepth = "../../../"
  5.   folderDepth = "../../"
  6.  
  7.   'example: backUrl = "index.asp"
  8.   backUrl = "template.asp"
  9.  
  10.   'We use session variables to hold the username and clearance when a member/ Member/ staffMember login.
  11.   dim Username, Clearance, External
  12.   Username = session("Username")
  13.   Clearance = session("Clearance") 
  14.   External  = session("sess_usertype") 
  15.  
  16.   If Username <> "" Then
  17. %>
  18.  
  19. <title> NMBS: <%= pageName%> </title>
  20. <link rel="Stylesheet" type="text/css" href="<%= folderDepth%>CSS/ButtonStyles-BIDS.CSS" />
  21. <link rel="Stylesheet" type="text/css" href="<%= folderDepth%>CSS/whiteText-BIDS.CSS" />
  22. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  23.  
  24. <script type=text/javascript>
  25. var adImg = 0; // used to index the array
  26. var adURL = 1; // used to index the array
  27. var ad = new Array();
  28. var adOn = 0; // which ad is displayed currently
  29. function addImage(_i,_u) {
  30.   ad[ad.length?ad.length:0] = new Array();
  31.   ad[ad.length-1][adImg] = _i;
  32.   ad[ad.length-1][adURL] = _u;
  33. }
  34. if (document.images) {
  35. addImage("nmbs2.bmp");
  36. addImage("mechanics.jpg");
  37.  
  38.  
  39. function cycleAds() { 
  40.   if (document.images && document.adBanner.complete) { 
  41.      adOn = ++adOn % ad.length;
  42.      document.images.adBanner.src = ad[adOn][adImg]; 
  43.   } 
  44. }
  45. var delay = 2.5; // time in seconds to delay between ads.
  46. var adTimer = null;
  47. adTimer = setInterval("cycleAds()",delay*1000);
  48. function gotoAd() { 
  49. document.location.href = ad[adOn][adURL];
  50. }
  51. function showStatus() {
  52.   status = "GoTo: "+ad[adOn][adURL];
  53. }
  54. </script>
  55. </head>
  56.  
  57. <table border="3" cellpadding = "2" cellspacing="2" width="100%" bgColor="#3380b2">
  58.      <tr>
  59.       <th><h1><font color="white"><%= pageName%></font></h1></th> 
  60.           <td align="left"><img src ="pda.jpg" width="150" height="100"></td>
  61.       <td><a href='javascript:gotoAd()' onmouseout='status=""' onmouseover='showStatus();return true;'>
  62.       <img border=0 alt='' name=adBanner src='nmbs2.bmp' width="310" height="85"></a></td>
  63.      </tr>
  64. </table>



and im also including a footer file-which again is a simple message on the bottom of the page.


ive checked all my include files and the code within them- but cannot seem to find the problem. Any suggestions or coding would be helpful thanks
Dec 4 '06 #3

scripto
100+
P: 143
here you go

Resolution

add the following after the line <% Option Explicit %>:

<% Response.Buffer = True %>
Dec 4 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.