Last post Jan 10, 2006 01:39 PM by StrongTypes
Jan 10, 2006 02:23 AM|gabitron|LINK
Hello programmers of the world....
I'm new in visual studio.net and need to know how I can redirect a webform to the address that requested that funcion.... I know there's is one called response.redirect but I need to specify the URL which varies depending on the page that calls it.
Thanks for any input, and consider that I'm new to this asp/vb.net world
Jan 10, 2006 02:27 AM|StrongTypes|LINK
Using the below code, you can get the HTTP referrer and redirect to it.
As String = Request.ServerVariables("HTTP_REFERER")
Jan 10, 2006 05:16 AM|gabitron|LINK
hello and thanks for looking...
that's not working .. I'm in a windows 2003 machine, does that have something to do?
thanks again gabriel
Jan 10, 2006 05:56 AM|gabitron|LINK
Ok I needed the redirection after pressing a button.... so I placed the code there. A strange thing is that when I move the code to the page_load section it executes well...mmm...
here's my button code
Jan 10, 2006 11:27 AM|StrongTypes|LINK
Your best bet is to pass the previous URL in the form of a query string and then redirect to the query string.
As String = Request.QueryString(NameOfQueryString)
Jan 10, 2006 01:35 PM|osp70|LINK
I may be wrong here but since you are using it in a post back event the referrer page is the same page. You could save the url in the onload page event in the not is postback if statement that way you have the original page that called the page no matter
how many times your page calls itself.
hope this helps.
Jan 10, 2006 01:39 PM|StrongTypes|LINK