さて、次のコードで Home.aspx に次のエラーがあります
エラー:
Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).
Source Error:
Line 5: using System.Web.UI.WebControls;
Line 6:
Line 7: public partial class home : _BasePage
Line 8: {
Line 9: protected void Page_Load(object sender, EventArgs e)
Source File: h:\Sites\BaseSite\Home.aspx.cs Line: 7
コード:
public partial class home : _BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
これは、 System.Web.UI.Page を継承する必要があるためであることがわかりました。
ただし、これは私の _Basepage クラスです:
using System;
using System.Text;
using System.Web.UI;
using System.Web.UI.HtmlControls;
public class _BasePage : System.Web.UI.Page
{
/// code
}
この概念は VB でうまく機能しますが、ここで何が間違っているのでしょうか?