0

MasterParent というクラスから継承したマスター ページがあります。コンパイル中に、次のようなエラーが発生します。

コンパイル エラー:

説明: この要求を処理するために必要なリソースのコンパイル中にエラーが発生しました。次の特定のエラーの詳細を確認し、ソース コードを適切に変更してください。

コンパイラ エラー メッセージ: ASPNET: このコード ファイルで定義されているクラスが 'inherits' 属性と一致し、正しい基本クラス (Page または UserControl など) を拡張していることを確認してください。

ソース エラー:

Line 8:  namespace PortfolioApplication
Line 9:  {
Line 10:     public partial class MasterPage : MasterParent
Line 11:     {
Line 12:     }

私のコード:MasterParent.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PortfolioApplication
{
    public abstract class MasterParent : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        #region "Navigation Buttons"

        protected void btnPortfolio_Click(object sender, EventArgs e)
        {
            Server.Transfer("Portfolio.aspx");
        }
        protected void btnHome_Click(object sender, EventArgs e)
        {
            Server.Transfer("Default.aspx");
        }
        protected void btnContact_Click(object sender, EventArgs e)
        {
            Server.Transfer("Contact.aspx");
        }
        protected void btnResume_Click(object sender, EventArgs e)
        {
            Server.Transfer("Resume.aspx");
        }

        #endregion
    }
}

MasterPage.master.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PortfolioApplication
{
    public class MasterPage : MasterParent 
    {

    }
}

また: クラス ヘッダーの MasterParent.cs のコードを変更しようとしました。

public partial class MasterPage: System.WEb.UI.MasterPage and i am getting the same error about inheritence.
4

1 に答える 1

0

partialのすべての定義に修飾子があるわけではありませんMasterPage : MasterParent

于 2012-11-01T19:37:26.347 に答える