English 中文(简体)
C# App_Data等级,不由 as继承——继承归属问题
原标题:C# App_Data class not inherited by aspx - inherits attribute question

I have been trying to figure this out for a while now and even though there are plenty of Google results for the error message I receive the solution eludes me. I think that I am doing what I am supposed to be doing.

VS2010,我在App_Data创建了一个共同点。 共同点的内容是所有网页都使用的职能。 就我可以说,这是在多页之间交流守则背后守则的适当途径。

App_Datacommon.cs

namespace nprah
{
    public class BasePage : System.Web.UI.Page
    {
    }
{

鱼类-creek.aspx.cs

namespace nprah
{
    public partial class Fishck : BasePage
    {
    }
}

鱼类-creek.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="鱼类-creek.aspx.cs" Inherits="nprah.BasePage" %>  

如果我正确理解因先辈的归属,那么它确实需要包含空间名称。 矿井。 见

在我管理这一法典时,它产生了以下产出:

Compiler Error 信:ASPNET: 确保本法典界定的类别与遗产归属相符,并扩展正确的基类(例如,页或用户目录)。

资料来源:

Line 11: {
Line 12:
Line 13: public partial class Fishck : BasePage
Line 14: {
Line 15:

视觉演播室在设计过程中没有发现任何错误。 你可能提供的任何指导都会受到高度赞赏。 提前感谢。

最佳回答

在您的协会中,它应当

Inherits="nprah.Fishck"

您的履历应该与您的法典档案相匹配。

And also try to validate that : CodeFile="fish-creek.aspx.cs". Because with the name of the file you supplied it should be : Codefile="fishck.aspx.cs". Maybe just a typo.

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签