G
Garth17
I'm trying to figure out a solution for sharing common properties and
methods in all me .aspx and .ascx pages.
In classic ASP I would use include directives.
So far I have made 2 base classes WebFormBase and UserControlBase. And
then set all my webforms and usercontrols inherit from the appropriate
one. But this forces me to replicate my code between to the two base
classes.
I'm working with a project that is a mix between Classic ASP and
ASP.NET. Our session variables are placed into the HTTP-Header from a
very old ISAPI filter. We retrieve them using
Request.ServerVariable("HTTP_CUSTOMVAR") Calls.
For ASP.NET purposes I create a base class property for each of our
ISAPI session variables. So that inside the WebForm that inherit it
they are all documented with intellisys like Me.sesPersonID , etc.
But my problem is that I have to replicate these properties in both of
the base classes for webforms and usercontrols. I would like to code
this retrieval only once and have both the UserControlBaseClass and the
WebFormBaseClass use the same properties.
This would also be useful for public methods and functions that I want
to share in both User Controls and Webforms.
What are my best Options?
methods in all me .aspx and .ascx pages.
In classic ASP I would use include directives.
So far I have made 2 base classes WebFormBase and UserControlBase. And
then set all my webforms and usercontrols inherit from the appropriate
one. But this forces me to replicate my code between to the two base
classes.
I'm working with a project that is a mix between Classic ASP and
ASP.NET. Our session variables are placed into the HTTP-Header from a
very old ISAPI filter. We retrieve them using
Request.ServerVariable("HTTP_CUSTOMVAR") Calls.
For ASP.NET purposes I create a base class property for each of our
ISAPI session variables. So that inside the WebForm that inherit it
they are all documented with intellisys like Me.sesPersonID , etc.
But my problem is that I have to replicate these properties in both of
the base classes for webforms and usercontrols. I would like to code
this retrieval only once and have both the UserControlBaseClass and the
WebFormBaseClass use the same properties.
This would also be useful for public methods and functions that I want
to share in both User Controls and Webforms.
What are my best Options?