Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Redirect
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Redirect

 Post Reply Post Reply Page  12>
Author
twooly View Drop Down
Groupie
Groupie


Joined: 24 September 2003
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote twooly Quote  Post ReplyReply Direct Link To This Post Topic: Redirect
    Posted: 27 January 2004 at 10:56pm

Can someone tell me how to do a redirect in asp.net with variables in the redirect.  I know how to do it in plain asp but can't get it figured out.

I want to redirect with two varialbes

strOne, strTwo

       Response.Redirect "test2.aspx?ONE="& strOne"&"& strTwo

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2004 at 1:36am
Response.Redirect "test2.aspx?ONE=" & strOne & "&" & strTwo

Edited by dpyers

Lead me not into temptation... I know the short cut, follow me.
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2004 at 7:49am

plus in .NET you always have to have a set of parenthesis when calling a sub or function

Response.Redirect("test2.aspx?ONE=" & strOne & "&TWO=" & strTwo)

Contribute to the working anarchy we fondly call the Internet
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2004 at 9:13am
and if your parameters ought to be textboxes you have to put strOne.Text
just in case
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2004 at 1:16pm

Or create a custom parsing thing which looks a bit better (my opinion)

Response.Redirect("Test.aspx?" & strOne & "/" & strTwo)

/me likes doing some stuff different. Now you'll have to Split() the Request.ServerVariables("QUERY_STRING") and assing the variables back. A bit more work, but it 'looks' better.

Gone..
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2004 at 1:23pm
Or
Dim strRedirect As String = String.Format("Test.aspx?{0}/{1}", var1, var2)

Response.Redirect(strRedirect)
Back to Top
twooly View Drop Down
Groupie
Groupie


Joined: 24 September 2003
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote twooly Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2004 at 6:36pm
Awesome Thanks for the help.
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 28 January 2004 at 6:57pm

I believe & is replaced with + in ASP.NET

At least + is what i use. Not sure if & works the same.

Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.