5

I have a working website website project in visual studio. I can view all pages without a problem.

Now I copied 2 files from another Web Application Project I have: search.aspx search.aspx.vb

search.aspx source snippet

<%@ Page EnableViewState="true" EnableEventValidation="false" MetaDescription="<%$Resources:metadescription%>" Title="<%$Resources:pagetitle %>" Language="VB" MasterPageFile="~/main.master" AutoEventWireup="false" Inherits="search" Codebehind="search.aspx.vb" %>
<%@ MasterType VirtualPath="~/main.master" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

search.aspx.vb source snippet

Imports System
Imports System.Net
Imports System.IO
Imports GlobalFunctions
Imports System.Xml
Imports System.Collections.Generic
Imports System.Collections
Imports System.Linq
Imports System.Resources
Imports generalMethods
Imports System.Globalization

Partial Class search
    Inherits System.Web.UI.Page

But when I try to request the page: www.test.com/search.aspx I get this error: Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'search'.

Source Error:

Line 1:  <%@ Page EnableViewState="true" EnableEventValidation="false" MetaDescription="<%$Resources:metadescription%>" Title="<%$Resources:pagetitle %>" Language="VB" MasterPageFile="~/main.master" AutoEventWireup="false" Inherits="search" Codebehind="search.aspx.vb" %>
Line 2:  
Line 3:  <%@ MasterType VirtualPath="~/main.master" %>

Source File: /search.aspx    Line: 1 

When I tried building the project, I already see the error: Could not load type 'search'.
I have no idea anymore where to look for this.

4

2 に答える 2

11

Turns out I had to change "CodeBehind" to "CodeFile" in search.aspx...now it all works again.

于 2012-08-08T21:08:01.607 に答える
2

This can also occur if the WAP's DLL in the bin directory on the webserver is outdated and therefore does not contain a precompiled code behind for the requested page.

于 2012-09-25T12:51:00.023 に答える