Hi,
You can make a base page class that all of your pages inherit:
C#
public class BaseClass : System.Web.UI.Page
{
public string GetUserInfo()
{
return "1";
}
}
All of the aspx pages that need this method can inherit the BasePage class. Since BasePage inherits from System.Web.UI.Page, they will get access to all of the page methods and properties as well.
AspxPage Code Behind
public partial class CSharp : BaseClass
{
protected void Page_Load(object sender, EventArgs e)
{
GetUserInfo();
}
}
I hope this will help you out.