views:

49

answers:

2

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?

A: 

If you want to access the functions on each page, put them into a base class of all of your pages.

John Saunders
+1  A: 

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.

Sky Sanders