Another alternative is to create a base page class that inherits all of your pages:
public class BasePage : System.Web.UI.Page
{
public string GetUserInfo()
{...}
}
All aspx pages that need this method can inherit the BasePage class. Since BasePage inherits from System.Web.UI.Page, they will also have access to all the methods and properties of the page.
derek source
share