views:

252

answers:

1

i saw this article on msdn forum about Request.UrlReferrer but didnt really understand it well. I need to use this property in one of my pages to see where the user is coming from. My case is if the user comes from certain page, i need to have an if condition and should open up a popup as well as redirect page to next page. if the Request.UrlReferrer is null then i dont need the popup, just goto next page. can somebody put a sample code snippet here? this is what i have so far -

Public ReadOnly Property URLReferrer() As uri
    Get

    End Get
End Property

i am not sure what to put with the Get and End Get.

+1  A: 

UrlReferrer is already a property of the Request, you don't need to declare it. Just use the instance of the Request from the Page object (assuming web forms). Page.Request.UrlReferrer

AUSteve
this is what i put now -Dim referrer As uri If Not IsPostBack Then If Not Request.UrlReferrer Is Nothing Then referrer = Request.UrlReferrer End If End Ifnow how do i say if referrer = "www.mysite.com/page1.aspx" then popup /page2.aspx and onsubmit /page3.aspx else onsubmit /page3.aspx
unire
A popup window must be opened using client script (JavaScript) so when your referrer is page1.aspx then you need to write the appropriate client script to the page. Google or search StackOverflow for ways to do this.
AUSteve