Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Response.Redirect & URL Variable

Reply
Thread Tools

Response.Redirect & URL Variable

 
 
TomT
Guest
Posts: n/a
 
      11-17-2004
Hi..

I'm redirecting users to another page using:

response.redirect("newpage.asp")

this works... But I need to add a variable to the page specified..

IE: newpage.asp?id=JobID

EG:

JobID = 100

Doing a response.write JobID - Presents the correct result. - 100

However, If I use:

response.redirect("newpage.asp?id=JobID")

I get redirected to newpage.asp?id=JobID, not newpage.asp?id=100

How do I correct this ??

Thanks
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      11-17-2004
TomT wrote on 17 nov 2004 in microsoft.public.inetserver.asp.general:

> response.redirect("newpage.asp?id=JobID")
>
> I get redirected to newpage.asp?id=JobID, not newpage.asp?id=100
>


ASP vbscript:

response.redirect "newpage.asp?id=" & JobID

ASP jscript:

response.redirect( "newpage.asp?id=" + JobID );

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      02-23-2006
I can't reproduce this problem. Tell me if the following two pages work as
intended for you:

Redirect2Variable.asp:
<%
dim url
url="RedirectTarget.asp?a=5"
Response.Redirect url
%>


RedirectTarget.asp:
<%
for each key in Request.QueryString
Response.Write key & ": " & Request.QueryString(key)
next
%>

Here is the output I see when I load Redirect2Variable.asp:
a: 5

Tell me what I need to change to make my page reproduce your symptoms.

Bob Barrows

elmo wrote:
> I've got the same problem...
>
> de page must rdirect to Costumersview.asp?key=1
> when i do a response.redirect to Costumersview.asp?key=1 the redirect
> doen't have any problems but when i do it from a variable
> then the script won't redirect to Costumersview.asp?key=1
> i use the following code to de a redirect
>
> response.redirect terug
>
> When i do a response.write (terug) i'v got the following text
> Costumersview.asp?key=1
>
> is there someone who is familliar with this problem
>
> Eltjo Schol
> Netherlands
>
> Evertjan. wrote:
>> *TomT wrote on 17 nov 2004 in
>> microsoft.public.inetserver.asp.general:
>>
>>> response.redirect("newpage.asp?id=JobID")
>>>
>>> I get redirected to newpage.asp?id=JobID, not newpage.asp?id=100
>>>

>>
>> ASP vbscript:
>>
>> response.redirect "newpage.asp?id=" & JobID
>>
>> ASP jscript:
>>
>> response.redirect( "newpage.asp?id=" + JobID );
>>
>> --
>> Evertjan.
>> The Netherlands.
>> (Please change the x'es to dots in my emailaddress,
>> but let us keep the discussions in the newsgroup) *

>
>
>
> --
> elmo
> ------------------------------------------------------------------------
> Posted via http://www.codecomments.com
> ------------------------------------------------------------------------


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-23-2006
elmo wrote on 23 feb 2006 in microsoft.public.inetserver.asp.general:
> Evertjan. wrote:
>> *TomT wrote on 17 nov 2004 in
>> microsoft.public.inetserver.asp.general:
>> > response.redirect("newpage.asp?id=JobID")
>> > I get redirected to newpage.asp?id=JobID, not newpage.asp?id=100

>>
>> ASP vbscript:
>>
>> response.redirect "newpage.asp?id=" & JobID
>>
>> ASP jscript:
>>
>> response.redirect( "newpage.asp?id=" + JobID );

>
> I've got the same problem...
>
> de page must rdirect to Costumersview.asp?key=1
> when i do a response.redirect to Costumersview.asp?key=1 the redirect
> doen't have any problems but when i do it from a variable
> then the script won't redirect to Costumersview.asp?key=1
> i use the following code to de a redirect
>
> response.redirect terug
>
> When i do a response.write (terug) i'v got the following text
> Costumersview.asp?key=1
>
> is there someone who is familliar with this problem


[please do not toppost on usenet]

Interesting, Eljo, you are responding on my posting of Nov 17 2004!!!

Reading the posting in the proper sequence, I cannot follow what our
problem is. My explanation covers something that you do not show in your
sparse bit of code.

If you are useing ASP-vbscript, there is no reason to use () here.

Let us start debugging:
Supposing Costumersview.asp being in the same directory as test.asp,
make a test.asp file/page with only(!!):

<%
terug = "Costumersview.asp?key=1"
response.redirect terug
%>

.... and tell us where you get.

Je kan ook in het Nederlands antwoorden,
maar wel graag het antwoord onder de aangehaalde tekst.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Variable variable name" or "variable lvalue" mfglinux Python 11 09-12-2007 03:08 AM
URL - substitution of a correct URL by a GUID like URL in favorites. Just D. ASP .Net Mobile 0 08-11-2004 04:26 PM
redirect URL's, return URL's, and URL Parameters Jon paugh ASP .Net 1 07-10-2004 05:29 AM
How do I scope a variable if the variable name contains a variable? David Filmer Perl Misc 19 05-21-2004 03:55 PM
Solution for: "Unable to validate that the file <name> matches the URL <url>" Doug ASP .Net 0 07-06-2003 02:40 PM



Advertisments