1

Sometimes in my web applications I used to get this sort of error, I have no clue why is it coming however if I refresh the page few times the page is loading normally. enter image description here

I am using .net framework 2.0 and visual web developer 2005.

4

2 回答 2

3

我只在文件中包含的类与 HTML 页面中调用的类不同时看到此错误消息

例如,在您的 html 页面顶部会有一行代码,如下所示:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="@whereyourcodeis.aspx.cs" Inherits="@ClassName" Title="whatever" %>

在你的 whereyourcodeis.aspx.cs 文件中应该有一个构造函数方法,它与你的 html 中的继承行同名。IEClass ClassName{ rest of your code}

如果由于某种原因这两个名称不匹配,您会遇到错误,希望这可以阐明您的代码出错的地方

于 2012-05-28T16:32:13.357 回答
0

当我偶然更改另一个 aspx 文件的代码文件以指向与当前页面文件相同的代码文件时,它发生在我身上。

确保每个 aspx 文件都指向正确的代码文件。Visual Studio 不会将您指向正确的文件。

您可以尝试搜索导致错误的文件的名称,以找到指向它的其他页面。

于 2012-11-18T13:48:53.673 回答