Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Response.Redirect and Request.QueryString


Message #1 by "Bengt" <asp@k...> on Thu, 18 May 2000 13:53:5
Hello!



Why doesn't the following code work:



if NOT isempty(Request.Form("Edit")) then

  Response.Redirect "red_produkt.asp?ProdNr=" & 

Request.QueryString("ProdNr")

end if



The code only produces (when I click on the Edit button in the form) the 

URL-string: "red_produkt.asp?ProdNr=" and not, as expected: 

"red_produkt.asp?ProdNr=16-1".



If I write (on the same page) "<% response.write 

Request.QueryString("ProdNr") %>" it outputs, as expected, "16-1"



Why?



Bengt

Message #2 by "Ken Schaefer" <ken.s@a...> on Thu, 18 May 2000 23:09:11 +1000
You'll need to Server.URLEncode Request.QueryString("ProdNR") at the very

least - because the "-" needs to be replaced by a %2.



To be honest though, you should be getting a Malformed URL Syntax (Netscape)

or no problem (IE).



Perhaps you could:



Response.Write("red_produkt.asp?ProdNR=" & Request.QueryString("ProdNr"))



and post that.



Cheers

Ken



----- Original Message -----

From: "Bengt" 

To: "ASP Databases" <asp_databases@p...>

Sent: Thursday, May 18, 2000 1:00 PM

Subject: [asp_databases] Response.Redirect and Request.QueryString





> Hello!

>

> Why doesn't the following code work:

>

> if NOT isempty(Request.Form("Edit")) then

>   Response.Redirect "red_produkt.asp?ProdNr=" &

> Request.QueryString("ProdNr")

> end if

>

> The code only produces (when I click on the Edit button in the form) the

> URL-string: "red_produkt.asp?ProdNr=" and not, as expected:

> "red_produkt.asp?ProdNr=16-1".

>

> If I write (on the same page) "<% response.write

> Request.QueryString("ProdNr") %>" it outputs, as expected, "16-1"

>

> Why?

>

> Bengt





Message #3 by "Philip.Ware" <Philip.Ware@e...> on Thu, 18 May 2000 14:05:13 +0100
Try passing the request.querystring("ProdNr") to a variable first and then

doing the response.redirect

e.g.



	number =  Request.QueryString("ProdNr")



	Response.Redirect "red_produkt.asp?ProdNr=" & number



???









> -----Original Message-----

> From: Bengt 

> Sent: 18 May 2000 02:00

> To: ASP Databases

> Subject: [asp_databases] Response.Redirect and Request.QueryString

> 

> 

> Hello!

> 

> Why doesn't the following code work:

> 

> if NOT isempty(Request.Form("Edit")) then

>   Response.Redirect "red_produkt.asp?ProdNr=" & 

> Request.QueryString("ProdNr")

> end if

> 

> The code only produces (when I click on the Edit button in 

> the form) the 

> URL-string: "red_produkt.asp?ProdNr=" and not, as expected: 

> "red_produkt.asp?ProdNr=16-1".

> 

> If I write (on the same page) "<% response.write 

> Request.QueryString("ProdNr") %>" it outputs, as expected, "16-1"

> 

> Why?

> 

> Bengt

Message #4 by "Ranga Nathan" <ranga@g...> on Thu, 18 May 2000 09:14:44 -0400
To continue over a line, you need &_

So add a _ after the &  it will work



-----Original Message-----

From: Bengt 

Sent: Thursday, May 18, 2000 1:00 PM

To: ASP Databases

Subject: [asp_databases] Response.Redirect and Request.QueryString





Hello!



Why doesn't the following code work:



if NOT isempty(Request.Form("Edit")) then

  Response.Redirect "red_produkt.asp?ProdNr=" &

Request.QueryString("ProdNr")

end if



The code only produces (when I click on the Edit button in the form) the

URL-string: "red_produkt.asp?ProdNr=" and not, as expected:

"red_produkt.asp?ProdNr=16-1".



If I write (on the same page) "<% response.write

Request.QueryString("ProdNr") %>" it outputs, as expected, "16-1"



Why?



Bengt



Message #5 by "Morrow, Jeff" <jmorrow@u...> on Thu, 18 May 2000 08:32:26 -0500
you may try rewriting your if statement something like this:

	

	If (isempty(Request.Form("Edit")) = False) Then

		Response.Redirect "red_produkt.asp?ProdNr=" & 

			Request.QueryString("ProdNr")

	End if





-----Original Message-----

From: Bengt 

Sent: Wednesday, May 17, 2000 8:00 PM

To: ASP Databases

Subject: [asp_databases] Response.Redirect and Request.QueryString





Hello!



Why doesn't the following code work:



if NOT isempty(Request.Form("Edit")) then

  Response.Redirect "red_produkt.asp?ProdNr=" & 

Request.QueryString("ProdNr")

end if



The code only produces (when I click on the Edit button in the form) the 

URL-string: "red_produkt.asp?ProdNr=" and not, as expected: 

"red_produkt.asp?ProdNr=16-1".



If I write (on the same page) "<% response.write 

Request.QueryString("ProdNr") %>" it outputs, as expected, "16-1"



Why?



Bengt


  Return to Index