G
Guest
I've created a custom base class for my asp.net web pages that needs to
retrieve the URL of the calling page from the New method. Problem is that
the Request property of the page is not available until after the base code
completes. How can I get the page URL from the New method?
Partial Class MyPage
Inherits MyBaseClass
End Class
Public Class MyBaseClass
Inherits System.Web.UI.Page
Public Sub New()
'Need to get page URL here, but Request is not available yet
Dim url as string = Request.ServerVariables("HTTP_HOST")
'do stuff based on url
End Sub
End Class
retrieve the URL of the calling page from the New method. Problem is that
the Request property of the page is not available until after the base code
completes. How can I get the page URL from the New method?
Partial Class MyPage
Inherits MyBaseClass
End Class
Public Class MyBaseClass
Inherits System.Web.UI.Page
Public Sub New()
'Need to get page URL here, but Request is not available yet
Dim url as string = Request.ServerVariables("HTTP_HOST")
'do stuff based on url
End Sub
End Class