Question Response.Redirect "?src=" variable

vbnewbi

New member
Joined
Oct 7, 2011
Messages
2
Programming Experience
Beginner
Hi, I'm fairly new to VB.net. I'm creating a basic website in Visual Web Developer 2010 Express in ASP.NET/VB and I'm trying to find out how to use Reponse.Redirect with a "?src=" parameter to redirect to another site and keep the same source string in the redirected site.

For example:

Visitor goes to http://www.test.com?src=source1 and gets redirected to http://www.site-a.com?src=source1
Visitor goes to http://www.test.com?src=source2 and gets redirected to http://www.site-a.com?src=source2

and so on

I don't want to hard code:
VB.NET:
Response.Redirect("http://site-a.com?src=source1")
for each possible source. I want whatever source string is in the original visit to pass into the Response.Redirect and show on the destination page, something like:
VB.NET:
Response.Redirect(http://site-a.com?src=" + mysource)
But how do actually I code this in VB.net to read the source string in the first URL and automatically add it to the destination URL?

Thanks for any help on this.
 
I do something like this, where the ReturnUrl = "myspace.com/gohere.aspx" and the original URL is : "myspace.com/washere.aspx"&ReturnUrl="myspace.com/gohere.aspx"

Dim strReturnUrl As String = Request.QueryString("ReturnUrl")

Response.Redirect(strReturnUrl)


Note that there should not be quotes around the URLs. I had to do that so this text editor did not try and make them into links

 
Last edited:
Back
Top