Protected Sub ReturnButton_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles ReturnButton.Load
If Request.UrlReferrer IsNot Nothing Then
'Here we know this page was loaded as a result of the user clicking on a link from another page.
ReturnButton.Visible = True
'Provide JavaScript to refresh the calling page and close this page.
'Doing this without a return page would cause a JavaScript error when the button is clicked because where wouldn't be an opener page to go back to.
ReturnButton.OnClientClick = "window.opener.location.reload(); window.close()"
Else
ReturnButton.Visible = False
End If
End Sub
Tips and tricks for .NET using ASP and VB code.
Close this window and refresh the calling page.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment