VB: using Controls collection

ViewState("UrlReferrer")

Sub Page_Load()
If Page.IsPostBack = False Then
' Store URL Referrer to return to home page.
ViewState("UrlReferrer") = Me.Request.UrlReferrer.ToString()
End If
End Sub
Sub CancelBtn_Click()
' Redirect back to the home page.
Me.Response.Redirect(CType(ViewState("UrlReferrer"), String))
End Sub