好吧我已在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中工作正常不過我究竟錯在這裏做什麼?
你查看的頁面之前編譯?任何編譯錯誤? – Oded
你確定你沒有任何其他錯誤?因爲可能是'_BasePage'由於其他錯誤而未編譯。 – Habib