Is it possible to create a function that can be called by multiple different pages in asp.net?
Say for example I have a method that takes two int parameters and adds them together and spits out the result
public int test(int a, int b)
{
return a+b;
}
If I wanted to use this function on three different pages, how would I do it?
notes:
using C#
.NET 4
Entity Framework
This method can be made static and you can put such methods into a static class like this.
can call it from any page.
The other option is, if it’s some page oriented function, you could create your own class that extends
Pageclass and add function there and if you make all your pages extend this custom class, the functions will be available.