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

Response.redirect

P: n/a
I'm not getting the results I want when I use
Response.Redirct in a ASP page.

I enter this line of code in a asp page from domain1.com.
Response.Redirect "http://www.domain2.com/VDIR2/table.asp"
& "?PubID=" & PubID & "&PubName=" & PubName

The query string is data to open a DB. the page displays
but the DB does not open.

That's because when it redirects I notice in the address
bar of IE that it looks like this

http://www.domain1.com/VDIR1/table.asp?
PubID=100&PubName=thename

I told it to redirect to domain2 but I see domain1 in the
address bar.

If I type out the URL to domain2 with all the params
everything works fine, so the problem is with how I am
redirecting there.

The redirect above is inside an IF statement which says if
the PubID is less then 100 I go to the table.asp page on
domain2.com else I stay with table.asp on domain1.com

Any ideas

PAul

Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Gazing into my crystal ball I observed "Paul"
<an*******@discussions.microsoft.com> writing in news:06ce01c39447$98c015a0
$a*******@phx.gbl:
I'm not getting the results I want when I use
Response.Redirct in a ASP page.

I enter this line of code in a asp page from domain1.com.
Response.Redirect "http://www.domain2.com/VDIR2/table.asp"
& "?PubID=" & PubID & "&PubName=" & PubName

The query string is data to open a DB. the page displays
but the DB does not open.

That's because when it redirects I notice in the address
bar of IE that it looks like this

http://www.domain1.com/VDIR1/table.asp?
PubID=100&PubName=thename

I told it to redirect to domain2 but I see domain1 in the
address bar.

If I type out the URL to domain2 with all the params
everything works fine, so the problem is with how I am
redirecting there.

The redirect above is inside an IF statement which says if
the PubID is less then 100 I go to the table.asp page on
domain2.com else I stay with table.asp on domain1.com

Any ideas

PAul


What happens if you response.write in the IF statement?

if pubid < 100 then
response.write "I am going to domain2"
else
response.write "I staying right here"
end if

Is Pubid really a number, or is it a string? If it's a string, convert it
to a number, and then test it.

--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com
Jul 19 '05 #2

P: n/a
If I do the test you suggested it works as expected. and
yes PubId is a number.

The If statement works correctly, if pubID > 100 I stay on
my IIS server, if PubID < 100 I redirect to another IIS
server someplace else. the problem occurs when PubId < 100
and I redirect using this line of code:

Response.Redirect "http://www.domain2.com/VDIR2/table.asp"
& "?PubID=" & PubID & "&PubName=" & PubName

When PubId < 100 I see In the IE address bar the redirect
above with the acception that www.domain2.com is replaced
with www.domain1.com.

domain1 is my domain, It points to my IIS server, domain2
is somebody elses IIS server that I need to redirect to.

When PubID < 100 and things fail, I merely need to edit
the address bar URL by changing domain1.com to domain2.com
and hit return. Then I get what I want.

So some how even though I redirect to domain2 something is
replacing it with domain1.


-----Original Message-----
Gazing into my crystal ball I observed "Paul"
<an*******@discussions.microsoft.com> writing in news:06ce01c39447$98c015a0$a*******@phx.gbl:
I'm not getting the results I want when I use
Response.Redirct in a ASP page.

I enter this line of code in a asp page from domain1.com.

Response.Redirect "http://www.domain2.com/VDIR2/table.asp" & "?PubID=" & PubID & "&PubName=" & PubName

The query string is data to open a DB. the page displays but the DB does not open.

That's because when it redirects I notice in the address bar of IE that it looks like this

http://www.domain1.com/VDIR1/table.asp?
PubID=100&PubName=thename

I told it to redirect to domain2 but I see domain1 in the address bar.

If I type out the URL to domain2 with all the params
everything works fine, so the problem is with how I am
redirecting there.

The redirect above is inside an IF statement which says if the PubID is less then 100 I go to the table.asp page on domain2.com else I stay with table.asp on domain1.com

Any ideas

PAul

What happens if you response.write in the IF statement?

if pubid < 100 then
response.write "I am going to domain2"
else
response.write "I staying right here"
end if

Is Pubid really a number, or is it a string? If it's a

string, convert itto a number, and then test it.

--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com
.

Jul 19 '05 #3

P: n/a
I just figured it out.

You need to do a Response.Clear before you redirect to
another server.

Thanks anyway
-----Original Message-----
If I do the test you suggested it works as expected. and
yes PubId is a number.

The If statement works correctly, if pubID > 100 I stay onmy IIS server, if PubID < 100 I redirect to another IIS
server someplace else. the problem occurs when PubId < 100and I redirect using this line of code:

Response.Redirect "http://www.domain2.com/VDIR2/table.asp" & "?PubID=" & PubID & "&PubName=" & PubName

When PubId < 100 I see In the IE address bar the redirect
above with the acception that www.domain2.com is replaced
with www.domain1.com.

domain1 is my domain, It points to my IIS server, domain2
is somebody elses IIS server that I need to redirect to.

When PubID < 100 and things fail, I merely need to edit
the address bar URL by changing domain1.com to domain2.comand hit return. Then I get what I want.

So some how even though I redirect to domain2 something isreplacing it with domain1.


-----Original Message-----
Gazing into my crystal ball I observed "Paul"
<an*******@discussions.microsoft.com> writing innews:06ce01c39447$98c015a0
$a*******@phx.gbl:
I'm not getting the results I want when I use
Response.Redirct in a ASP page.

I enter this line of code in a asp page fromdomain1.com.

Response.Redirect "http://www.domain2.com/VDIR2/table.asp"

& "?PubID=" & PubID & "&PubName=" & PubName

The query string is data to open a DB. the pagedisplays but the DB does not open.

That's because when it redirects I notice in theaddress bar of IE that it looks like this

http://www.domain1.com/VDIR1/table.asp?
PubID=100&PubName=thename

I told it to redirect to domain2 but I see domain1 inthe address bar.

If I type out the URL to domain2 with all the params
everything works fine, so the problem is with how I am
redirecting there.

The redirect above is inside an IF statement which
saysif the PubID is less then 100 I go to the table.asp pageon domain2.com else I stay with table.asp on domain1.com

Any ideas

PAul


What happens if you response.write in the IF statement?

if pubid < 100 then
response.write "I am going to domain2"
else
response.write "I staying right here"
end if

Is Pubid really a number, or is it a string? If it's a

string, convert it
to a number, and then test it.

--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com
.

.

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.