在文件夹下开发网页时加载类时出错 [英] Error loading class when developing web pages under folders

查看:68
本文介绍了在文件夹下开发网页时加载类时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用VS.NET 2003创建了一个新文件夹。然后我在该文件夹下创建了一个新的Web表单

,比如说\ Member\Default.aspx。但是,即使我没有对该页面执行任何操作,当我尝试运行它时会出现运行时错误 -


可以不加载类MySite._Default。


我用VB编写代码。有谁知道为什么这个问题会发生?b $ b?谢谢!

I created a new folder using VS.NET 2003. Then I created a new web form
under that folder, say, \Member\Default.aspx. However, even if I didn''t do
anything to that page, a run-time error appears when I try to run it --

Can not load class MySite._Default.

I am using VB to write codes. Does anyone have any idea why this problem
happens? Thanks!

推荐答案

你建了吗?菜单>构建>构建解决方案


Duron写道:
Did you build it? Menu > Build > Build solution

Duron wrote:
我使用VS.NET 2003创建了一个新文件夹。然后我创建了一个新的Web表单
在该文件夹下,例如\ Member\Default.aspx。但是,即使我没有对该页面做任何事情,当我尝试运行它时会出现运行时错误 -

无法加载类MySite._Default。 br />
我用VB编写代码。有谁知道为什么会出现这个问题?谢谢!
I created a new folder using VS.NET 2003. Then I created a new web form
under that folder, say, \Member\Default.aspx. However, even if I didn''t do
anything to that page, a run-time error appears when I try to run it --

Can not load class MySite._Default.

I am using VB to write codes. Does anyone have any idea why this problem
happens? Thanks!





错误可能与类名不匹配(如在.aspx.vb中)与.aspx页面中的继承不匹配(在< @ Page>指令中)

所以转到Default.aspx页面并检查继承和@Page指令中的属性。值可能是Inherits ="<此项目的ASP.NET项目名称/命名空间> .Default其中默认是.aspx文件的名称。并检查Default.aspx.vb以获取类声明。它应该像公共类默认


如果它们不相同,请更改,然后再试一次


希望这会有用很好


KVRavindra Kuma

----- Duron写道:----


我创造了使用VS.NET 2003创建一个新文件夹。然后我在该文件夹下为

创建了一个新网站,例如\ Member\Default.aspx。但是,即使我没有向该页面发送任何内容,当我尝试运行它时会出现运行时错误 -


无法加载class MySite._Default


我用VB编写代码。有没有人知道为什么这个问题会发生?b $ b?谢谢

Hi
the error may be b''se of not matching the class name (as in .aspx.vb) does not match with Inheritance in your .aspx page (in <@ Page > directive)
So go to your Default.aspx page and check the "Inherits" attribute in the @ Page directive. The value might be Inherits="<your ASP.NET project name/namespace of this project>.Default" where "Default" is the name of the .aspx file. And also check Default.aspx.vb for class declaration. It should be like "Public class Default"

If they are not same, change and then try again

Hope this will work out fine

K.V.Ravindra Kuma
----- Duron wrote: ----

I created a new folder using VS.NET 2003. Then I created a new web for
under that folder, say, \Member\Default.aspx. However, even if I didn''t d
anything to that page, a run-time error appears when I try to run it -

Can not load class MySite._Default

I am using VB to write codes. Does anyone have any idea why this proble
happens? Thanks


我已经尝试了几次和不同的方式来改变路径,但仍然是徒劳的。即使我只是创建一个新文件夹(/ Member)并在其下创建一个新的web

表单(Default.aspx),然后按F5,也会出现相同的运行时错误。


VS.NET生成的Page标签如下,未经修改,


<%@ Page Language =" vb" AutoEventWireup =" false"
Codebehind =" Default.aspx.vb"继承= QUOT; MySite._Default" %>


更糟糕的是,如果我尝试了相同的东西2或3次,ASP.NET服务

会崩溃(它显示非常简单的错误消息,如服务

浏览器中的不可用。我需要重新启动我的Windows以使其工作

再次。


这个问题在其他人的机器上是否可以重现?或者我是唯一的幸运

一个?


我现在正在采取的一个步骤是为该文件夹创建一个新项目/>
到目前为止工作正常。但我真的很想知道这是否是开发我的

网站的最佳方式。


Ravindra < an ******* @ discussion.microsoft.com>

:D8 *********************** ***********@microsoft.co m ...
I''ve tried several times and different ways in changing the path but still
in vain. Even if I simply create a new folder (/Member) and create a new web
form (Default.aspx) under it, then press F5, the same run-time error occurs.

The Page tag generated by VS.NET is as the following, unmodified,

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="Default.aspx.vb" Inherits="MySite._Default" %>

Even worse, if I tried the same thing for 2 or 3 times, the ASP.NET service
gets crashed (it displays a very simple error message like ''Service
Unavailable'' in the browser). I need to restart my Windows to make it work
again.

Is this problem reproducible on anyone else'' machine? Or I''m the only lucky
one?

An walkaround I''m now taking is make a new project for the folder and it
works fine so far. But I really wonder if this is the best way to develop my
web site.

"Ravindra" <an*******@discussions.microsoft.com>
:D8**********************************@microsoft.co m...

错误可能是不匹配类名(如.aspx.vb)你的.aspx页面中的
与继承不匹配(在< @ Page>指令中)。所以转到Default.aspx页面并检查继承和继承。
@ Page指令中的属性。值可能是Inherits ="<您的ASP.NET项目

此项目的名称/命名空间> .Default其中默认是

..aspx文件的名称。并检查Default.aspx.vb以获取类声明。它应该像公共类默认一样
$
如果它们不相同,请更改然后重试。

希望这会很好。

KVRavindra Kumar
----- Duron写道:-----

我使用VS.NET 2003创建了一个新文件夹。然后我创建了该文件夹下的新网页
表格,例如\ Member\Default.aspx。但是,即使我
没有对该页面执行任何操作,当我尝试运行
时会出现运行时错误 -
无法加载类MySite._Default。

我用VB编写代码。有谁知道为什么这个
问题会发生?谢谢!
Hi,
the error may be b''se of not matching the class name (as in .aspx.vb) does not match with Inheritance in your .aspx page (in <@ Page > directive). So go to your Default.aspx page and check the "Inherits" attribute in the @ Page directive. The value might be Inherits="<your ASP.NET project
name/namespace of this project>.Default" where "Default" is the name of the
..aspx file. And also check Default.aspx.vb for class declaration. It should
be like "Public class Default".
If they are not same, change and then try again.

Hope this will work out fine.

K.V.Ravindra Kumar
----- Duron wrote: -----

I created a new folder using VS.NET 2003. Then I created a new web form under that folder, say, \Member\Default.aspx. However, even if I didn''t do anything to that page, a run-time error appears when I try to run it --
Can not load class MySite._Default.

I am using VB to write codes. Does anyone have any idea why this problem happens? Thanks!



这篇关于在文件夹下开发网页时加载类时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆