While redirecting you can do
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Session("userid") = Nothing Then
Response.Redirect("login.aspx?Url=" & Server.UrlEncode(Request.Url.AbsoluteUri))
End If
End Sub
And on Login Page use the following redirecting logic
Dim url As String = Request.QueryString("url")
If Not String.IsNullOrEmpty(url) Then
Response.Redirect(Server.UrlDecode(url))
Else
Response.Redirect("~/Login.aspx"))
End If