Reputation: 2303
Do anyone knows about the class which has the common function which we generally use while developing web application. I have no idea what you may call it, it may be the utility class or common function class. Just for reference, this class can have some common function like:
The idea is to have the collection of function which we generally use while developing asp.net application.
Upvotes: 1
Views: 3011
Reputation: 11
Gotta love the intarwebs - An endless stream of people eager to criticize your style while completely failing to address the obvious "toy" question. ;)
Chris, you want to inherit all your individual page classes from a common base class, which itself inherits from Page. That will let you put all your shared functionality in a single place, without needing to duplicate it in every page.
Upvotes: 1
Reputation: 9864
In your example it looks like utility class - it is set of static functions.
But I think that you should group it in few different classes rather than put all methods in one class - you shouldn't mix UI functions(6) with string functions(3,4), IO functions (2) and math(1).
As Mormegil said - those functions exists in framework, but if you want to create your own implementations then I think that for part of your function the best solution is to create extension method.
Upvotes: 0
Reputation: 8071
No idea what you are really asking, but there already are ready-made methods for the tasks you write in various library classes:
Random.Next()
or RNGCryptoServiceProvider.GetBytes()
Path.GetDirectoryName()
String.Concat()
or simply x + y
String.IsNullOrEmpty()
Control.FindControl()
Upvotes: 3