我有两个类,我的页面和控件继承。这两个类获得相同的基本信息集,但按其原样执行两次。有没有办法从一个基类继承?ASP.NET会话继承
public partial class SessionPage : System.Web.UI.Page
{
protected override void OnInit(EventArgs e)
{
// Loads the session information from the database
// stores in member vars for the page to use
}
}
public partial class SessionControl : System.Web.UI.UserControl
{
protected override void OnInit(EventArgs e)
{
// Loads the session information from the database
// stores in member vars for the user control to use
}
}