Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

response .redirect with parameters?

Status
Not open for further replies.

uncleroydee

Technical User
Nov 28, 2000
79
US
Is it possible to use "RESPONSE.REDIRECT" with an ASP that passes parameters?

I'm trying to use an interim page to run a stored procedure that calls a contract number from the database, based on an item number, and then redirects to something like &quot;targetpage.asp?contractnumber=<%rst(&quot;contractnumber&quot;)%>&quot; using the contract number as a parameter. I haven't seen it done and what I've read makes me think it's difficult, if not impossible.

I've verified that the interim page is receiving the item number, running the SP, and retrieving the contract number with &quot;Response.Write&quot; statements (which I then removed)but that's where the wheels fall off.

I usually get an error like:
&quot;Header Error

/page.asp, line whatever

The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
&quot;

Thanks,
Roy

 
This type of error means that there are html headers being written to the page... and it always occurs when using response.redirect (unless you set your response.buffer to ??true?? or something like that)

You say it's an interim page, so I take that as meaning it displays nothing to the visitor, and only serves to call the stored procedure, and then redirect... yes?

If so, then just make sure you write no html on the page at all (only the server side code which is to execute), and then it should work just fine. No response.buffer needed if there are no headers.

hope it helps!:)
Paul Prewett

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top