Redirecting to another page
I have a development server which has a virtual path "http://localhost/proj1" as root, and there is another testing server which as virtual path as "http://localhost/sys/proj1". The difference is that the "proj1" is put under the "/sys" in testing server while it is not exist in the development server.
In order to aviod changing the path info of links in every web page, says from "http://localhost/proj1/form1.aspx" to ""http://localhost/sys/proj1/form1.aspx" , I write a public shared function in a class object, says CmnObj, which could be called by all web pages. The function look like this:
Public Shared Function Redirect(ByVal WebLink As String) As Boolean
Dim Request As System.Web.HttpRequest
Dim ServerLink As String = Request.path
ServerLink = ServerLink & "/" & WebLink
System.Web.HttpContext.Current.Server.Transfer(ServerLink)
End Function
In the web form, it calls the function like this:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CmnObj.Functions.Redirect("webform2.aspx")
End Sub
However, when executing the function, it always return me with "Nothing" in the variable "Request", so it will fail to get the Request.Path value. Could anyone give me some hints? Thank you.

