Bucky
Contributor
I have a bunch of functions that I want to use throughout my
ASP.NET project, and I want to put them in a module so the
entire project can use them.
This works fine with the code-behind pages, but if I want to call
one of these methods in the ASPX page itself (eg: <%
=GetNavBar() %>), the module is not in scope. The module and
the functions are both declared as Public.
Right now I have to put the methods in a class and declare a new
Public instance of the class in the code-behind page, which I can
then access from the ASPX code. This is a problem, however,
because I cannot access the Session variables directly, and a
new declaration of the class has to be put in every page.
Is there any way to declare the methods publicly so the ASPX
page can use them?
ASP.NET project, and I want to put them in a module so the
entire project can use them.
This works fine with the code-behind pages, but if I want to call
one of these methods in the ASPX page itself (eg: <%
=GetNavBar() %>), the module is not in scope. The module and
the functions are both declared as Public.
Right now I have to put the methods in a class and declare a new
Public instance of the class in the code-behind page, which I can
then access from the ASPX code. This is a problem, however,
because I cannot access the Session variables directly, and a
new declaration of the class has to be put in every page.
Is there any way to declare the methods publicly so the ASPX
page can use them?