**File :Views/Shared/Default.aspx:**
<%@ Page Language="C#" AutoEventWireup="True" CodeFile="Default.aspx.cs" Inherits="Views_Shared_Default" %>
文件:观看/共享/默认.aspx.cs:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class Views_Shared_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
Error: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).
My Documents\Visual Studio 2008\Projects\3ICMS\Views\Shared\Default.aspx.cs 15 14 C:\...\3ICMS\
P.S I have 2 Default.aspx files in my Project 3ICMS.
1 File is at 3ICMS\Views\Shared\Default.aspx.cs
2nd File is at 3ICMS\Default.aspx
我尝试过创建新文件并复制粘贴此代码。但是没有用。 我试过尝试将代码文件更改为代码隐藏...无法正常工作
如何解决这个问题?
答案 0 :(得分:1)
文件位于不同的文件夹视图和视图中,您应该放置完整的目录路径或将它们放在同一个文件夹中
<%@ Page Language="C#" AutoEventWireup="True" CodeFile="../../Views/Shared/Default.aspx.cs" Inherits="Views_Shared_Default" %>