【发布时间】:2012-01-23 02:42:48
【问题描述】:
我正在尝试覆盖我的类 _Default 中的 Page_PreInit 函数,该函数继承自 Page。但是,当我尝试编译时,出现以下错误:
'_Default.Page_PreInit(object, System.EventArgs)': 找不到合适的方法来覆盖
这是我的代码:
public partial class _Default : Page
{
protected override void Page_PreInit(object sender, EventArgs e)
{
// Todo:
// The _Default class overrides the Page_PreInit method and sets the value
// of the MasterPageFile property to the current value in the
// selectedLayout session variable.
MasterPageFile = Master.Session["selectedLayout"];
}
...
}
【问题讨论】:
标签: c# asp.net events webforms master-pages