Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load type 'newVersion_Default'

Upon trying to build the page Default.aspx I get the error:

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

The content page is:

<%@ 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>

And the code behind is empty!

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

This is probably a newbie error but any help appreciated :)

I can't rebuild the whole project yet because there's some other crap in the folders that is classic ASP which wont build and throw errors, so I have to build each page at a time, will this cause problems?

like image 905
Tom Gullen Avatar asked May 21 '26 12:05

Tom Gullen


1 Answers

In case of Web app:

Try use a namespace:

Inherits="MySite.newVersion_Default"

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

In case of Web site:

Use CodeFile instead of CodeBehind

like image 51
abatishchev Avatar answered May 23 '26 01:05

abatishchev