Never seen this done in asp.net, but never the less, can I define functions without being part of the class?
What I would like to have is a utility library. Currently I have Utils class and every time I need to use it for things like populating drop down lists i have to create and init the Utils() object…any way around that hassle aside from declaring the class static which I would rather not do as I access session in it?
I am using c#, not VB.
Thanks
There’s no way to have methods outside of classes.
The typical solution in your case is to create a Utility class full of static methods…that way you don’t have to worry about creating an instance of the class to utilize its methods.
And like Joel mentioned…you can still access the session from a static method.