I have some functions which will be call in some pages. I don't want to define the same functions in every page as it will be hard if I need change the code.
I've already use a class to hold the common functions and use that class in the page if I need those function.
But the problem is:
Some methods in the aspx.cs page are not available in the .cs class. Such as "Session", "Responce.Redirect","Page".
Let's say I have a function which check the session value and redirect the user.
string pId = Session["ProjectID"] as string ;
if (pId != null)
These codes get error in the .cs class but only work in aspx.cs page.
I don't know which namespace should be used in the .cs class.
Is there a way I can write this function in one place and call it in the page?
Thanks and I hope I've stated the problem clear.
View Complete Post