View Complete Post
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.
Any ideas how I can order inside the subquery? I get the following error. I have tried ORDER BY MAX([Count]) but it doesn't like this much either... Also, I don't want to use TOP in the subquery as I need to use all the records!
COUNT(*) AS [Count]
GROUP BY System_User_ID
ORDER BY [Count]) l
INNER JOIN aspnet_Membership m
ON CAST(m.UserId AS VARCHAR(36)) = l.System_User_ID