更新时间:2023-02-25 20:23:46
您需要声明测试()
方法主叫侧。使得它公共
是可能的,但似乎没有一个很好的主意。
You need to declare the Test()
method on the calling side. Making it public
may be possible but does not seem a very good idea.
public partial class TestPartial : System.Web.UI.Page
{
partial void Test(); // add this line
protected void Page_Load(object sender, EventArgs e)
{
Test();
}
}
public partial class TestPartial : System.Web.UI.Page
{
partial void Test()
{
// executed from Page_Load
}
}