2011-01-25 92 views
3

在试图建立的页面Default.aspx的我得到的错误:未能加载类型“newVersion_Default”

Error 5 Could not load type 'newVersion_Default'. \server1\d$\newVersion\Default.aspx

内容页:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="newVersion_Default" MasterPageFile="Main.master" %> 
<%@ MasterType VirtualPath="Main.master" %> 

<asp:Content id="Content2" contentplaceholderid="mainContent" runat="server"> 

    <h1>Welcome to this Page</h1> 

    <div class="tabWrapper"> 
     <div class="tab"><a href="#">Home</a></div> 
     <div class="tab"><a href="#">Tab 2</a></div> 
     <div class="tab tabSelected"><a href="#">Something Els wef wef w efe</a></div> 
     <div class="tab"><a href="#">Help!</a></div> 
     <div class="clear"></div> 
    </div>     
</asp:Content> 

而后面的代码是空的!

public partial class newVersion_Default : System.Web.UI.Page 
{ 
} 

这可能是一个新手的错误,但任何帮助赞赏:)

我不能重建整个项目还没有,因为有文件夹中的其他一些废话这是传统的ASP它不会建立和抛出错误,所以我必须一次构建每个页面,这会导致问题吗?

+0

它是网络应用程序项目或网站项目? – abatishchev

+0

这是一个经典的ASP网站的附加功能,我在VS2008中打开网站并打开网站,然后在'newversion'中添加一个新文件夹。它之前运行良好,直到我创建母版页,然后将其链接到。它作为独立页面构建得很好。 –

+0

看我更新的帖子 – abatishchev

回答

2

在Web应用程序的情况下:

尝试使用一个命名空间:

Inherits="MySite.newVersion_Default" 

namespace MySite 
{ 
    public partial class newVersion_Default : System.Web.UI.Page { } 
} 

在网站的情况下:

使用CodeFile而不是CodeBehind

+0

仍然不算运气,同样的错误。我已经命名空间的母版页和默认页面。 –

+0

超级!谢谢! –

+0

是的,完美的工作谢谢你! –

相关问题