I wrote a simple dll with only 2 functions in it. Is there a way to access these functions without having to instantiate them on every page?
Can't I add them to the web.config somehow as assemblies thus giving me access to them?
I wrote a simple dll with only 2 functions in it. Is there a way to access these functions without having to instantiate them on every page?
Can't I add them to the web.config somehow as assemblies thus giving me access to them?
If you want to access the functions on each page, put them into a base class of all of your pages.
Mark your methods as static
and you can call them from anywhere without instantiating the classes.
Your class:
public class MyClass
{
public static string HelloWorld()
{
return "Hello World";
}
}
Your Page:
string helloWord = MyClass.HelloWorld();
Static Classes and Static Class Members explained.