Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 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 September 30th, 2005, 03:23 PM
Registered User
 
Join Date: Sep 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Response.Redirect Problems

I am having problems with Response.Redirect. All the code will execute until the response.redirect, which after the code executes, the browser says,

 The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed. etc.etc.etc

It fails on
Response.Redirect "b_unsubscribe_submit_form_add.asp"


Here is my code....
<%
Dim adoCon
Dim rsDeleteEntry
Dim strSQL
Dim long_int
long_int = CLng(session("ID"))
    Set adoCon = Server.CreateObject("ADODB.Connection")
    adoCon.Open "DSN=sub-unsub"
    Set rsDeleteEntry = Server.CreateObject("ADODB.Recordset")
        strSQL = "SELECT Builder_Subscribe.* FROM Builder_Subscribe WHERE ID_no=" & long_int
    rsDeleteEntry.CursorType = 2
    rsDeleteEntry.Open strSQL, adoCon
if rsDeleteEntry.EOF=true then
    session("Email_Invalid")=Request.Form("Email")
    rsDeleteEntry.Close
    Response.Redirect "b_unsubscribe_error.asp"
else
    session("FirstName") = rsDeleteEntry("FirstName")
    session("LastName") = rsDeleteEntry("LastName")
    session("Email") = rsDeleteEntry("Email")
    session("Builder") = rsDeleteEntry("Builder")
    rsDeleteEntry.Delete
end if
rsDeleteEntry.Close
Set rsDeleteEntry = Nothing
Set adoCon = Nothing
Response.Redirect "b_unsubscribe_submit_form_add.asp"
%>

 
Old September 30th, 2005, 05:24 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

This is an ASP.NET forum, while your question deals with classic ASP.
For better answers, you're probably better of posting in one of the ASP forums.

That said, are you sure that this page is causing the error, and not the one you're redirecting to?

What happens when you request b_unsubscribe_submit_form_add.asp in the browser directly??

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Stay by Tricky (Track 1 from the album: Vulnerable) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
response.redirect sarah lee ASP.NET 1.0 and 1.1 Basics 1 October 27th, 2006 08:57 AM
response.redirect ava_h .NET Framework 2.0 0 October 18th, 2006 10:21 PM
response.redirect crmpicco Classic ASP Basics 3 February 9th, 2005 01:50 AM
What is an alternative for Response.Redirect pcshan Classic ASP Basics 3 April 28th, 2004 02:10 PM
Response.Redirect dhborchardt Classic ASP Basics 4 June 16th, 2003 05:56 AM





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