加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

ASP.NET分析器错误消息:无法加载类型“搜索”.从另一个项目复制

发布时间:2020-12-16 03:39:29 所属栏目:asp.Net 来源:网络整理
导读:我在visual studio有一个工作网站的网站项目. 我可以毫无问题地查看所有页面. 现在我从另一个Web应用程序项目复制了2个文件: search.aspx search.aspx.vb search.aspx源代码段 %@ Page EnableViewState="true" EnableEventValidation="false" MetaDescripti
我在visual studio有一个工作网站的网站项目.
我可以毫无问题地查看所有页面.

现在我从另一个Web应用程序项目复制了2个文件:
search.aspx
search.aspx.vb

search.aspx源代码段

<%@ 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源代码段

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

但是当我尝试请求页面时:www.test.com/search.aspx我收到此错误:
说明:解析为此请求提供服务所需的资源时发生错误.请查看以下特定的解析错误详细信息并相应地修改源文件.

分析器错误消息:无法加载类型“搜索”.

来源错误:

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

当我尝试构建项目时,我已经看到错误:无法加载类型“搜索”.
我不知道在哪里寻找这个.

解决方法

事实证明我必须在search.aspx中将“CodeBehind”更改为“CodeFile”…现在它再次起作用.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读