R
Random
I need to write a global function that I could use in every page codebehind
and every control. I've created a component (page_base.vb) that contains
the class Page_Base...
Public Class Page_Base
Inherits System.Web.UI.Page
Sub Page_Load(...)
(script that runs on every page)
End Sub
Public Function HostRequested() As String
HostRequested = Request.URL.Host
End Function
End Class
I am able to reference this on every page by substituting the "Inherits
System.Web.UI.Page" in the codebehind with "Inherits Page_Base". I am then
able to add onto the Page_Load procedure in the codebehind for any page
specific functionality. I am also able to access the HostRequested function
from the codebehind
So far so good....
Now I want to extend the accessibility to the HostRequested function to
controls that I am creating. The controls, however, cannot recognize the
HostRequested function. I cannot change the 'Inherits' tag because controls
inherit from the System.Web.UI.UserControl class instead of the
System.Web.UI.Page class.
How can I make my HostRequested function accessible from both page
codebehind and controls?
and every control. I've created a component (page_base.vb) that contains
the class Page_Base...
Public Class Page_Base
Inherits System.Web.UI.Page
Sub Page_Load(...)
(script that runs on every page)
End Sub
Public Function HostRequested() As String
HostRequested = Request.URL.Host
End Function
End Class
I am able to reference this on every page by substituting the "Inherits
System.Web.UI.Page" in the codebehind with "Inherits Page_Base". I am then
able to add onto the Page_Load procedure in the codebehind for any page
specific functionality. I am also able to access the HostRequested function
from the codebehind
So far so good....
Now I want to extend the accessibility to the HostRequested function to
controls that I am creating. The controls, however, cannot recognize the
HostRequested function. I cannot change the 'Inherits' tag because controls
inherit from the System.Web.UI.UserControl class instead of the
System.Web.UI.Page class.
How can I make my HostRequested function accessible from both page
codebehind and controls?