Determining previous page

G

Guest

How can you determine (in server code) the name/address of the page before the current page

Thanks
Andre
 
V

VB Programmer

You could pass the page in the QueryString or keep it in a session variable.
 
K

Ken Cox [Microsoft MVP]

Hi Andre,

Try this?

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim MyUrl As Uri = Request.UrlReferrer
If Not IsNothing(MyUrl) Then
Response.Write("Referrer URL name: " & _
MyUrl.AbsoluteUri & "<br>")
Response.Write("Referrer URL Port: " & _
MyUrl.Port & "<br>")
Response.Write("Referrer URL Protocol: " & _
MyUrl.Scheme & "<br>")
End If
End Sub

Ken
Microsoft MVP [ASP.NET]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top