473,783 Members | 2,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error loading class when developing web pages under folders

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!
Nov 18 '05 #1
13 1860
Did you build it? Menu > Build > Build solution

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!

Nov 18 '05 #2
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>.Defaul t" 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

Nov 18 '05 #3
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="Def ault.aspx.vb" Inherits="MySit e._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*******@disc ussions.microso ft.com>
:D8************ *************** *******@microso ft.com...
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>.Defaul t" 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!

Nov 18 '05 #4
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="Def ault.aspx.vb" Inherits="MySit e._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*******@disc ussions.microso ft.com>
:D8************ *************** *******@microso ft.com...
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>.Defaul t" 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!

Nov 18 '05 #5
"Duron" <jo*********@se ed.net.tw> wrote in message
news:uT******** ******@TK2MSFTN GP10.phx.gbl...
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!


What happens if you don't use a separate folder? What happens if you use a
file other than default.aspx?
--
John Saunders
johnwsaundersii i at hotmail
Nov 18 '05 #6
Hi Duron,
Actually the concept is : in a single namespace, you can not declare more than one class with same name.
Probably the declaration "Public Class Default" might appears moer than once in your whole application. In your case I hope you have created "Default.as px" more than once (though it appears in different folders in the same web app).
So the solution can be
1) Change the name of the class in "../Member/Default.asp.vb" file. Say "Public Class MemberDefault".
And accordingly change the @ Page directive as follows:
Inherits = "Mysite.MemberD efault"

2) The other way is decale a separate namespace within the file "./Member/Default.aspx.vb ". Say "Namespace Member". Here you no need to change the class declaration or name of the class.
And accordingly change @ Page directive as follows :
Inherits = "Mysite.Member. Default"

Here, one important note is, the name of the .aspx file and its class name may not be the same. It may be diferent.

Hope this will workout,

thanks & regards...
K.V.Ravindra Kumar

"Duron" wrote:
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="Def ault.aspx.vb" Inherits="MySit e._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*******@disc ussions.microso ft.com>
:D8************ *************** *******@microso ft.com...
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>.Defaul t" 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!


Nov 18 '05 #7
Hi Ravindra,

I've done some more tests. Here are something I found,

First, if I simply create a new folder, say Member, and then add a new web
page, say Default.aspx, it is working fine, no matter if there is another
Default.aspx at the root.

Then, I copied Web.config into /Member. After this, if I try to run
/Member/Default.aspx, an error message says I have to make this folder an
web application in IIS. I did so. But then the old error (can not load
namespace MySite._Default ) occurs.

I haven't done many things to Web.config except the following,

<authenticati on mode="None">
</authentication>
<authorizatio n>
<allow users="*" />
</authorization>

The reason why I add Web.config to that folder is because I want the root
folder be free to access while /Member needs certification. How do people
normally do this in VS.NET?

Thanks,

-Duron
"Ravindra" <Ra******@discu ssions.microsof t.com> ¼¶¼g©ó¶l¥ó·s»D
:A6************ *************** *******@microso ft.com...
Hi Duron,
Actually the concept is : in a single namespace, you can not declare more than one class with same name. Probably the declaration "Public Class Default" might appears moer than once in your whole application. In your case I hope you have created
"Default.as px" more than once (though it appears in different folders in the
same web app). So the solution can be
1) Change the name of the class in "../Member/Default.asp.vb" file. Say "Public Class MemberDefault". And accordingly change the @ Page directive as follows:
Inherits = "Mysite.MemberD efault"

2) The other way is decale a separate namespace within the file "./Member/Default.aspx.vb ". Say "Namespace Member". Here you no need to
change the class declaration or name of the class. And accordingly change @ Page directive as follows :
Inherits = "Mysite.Member. Default"

Here, one important note is, the name of the .aspx file and its class name may not be the same. It may be diferent.
Hope this will workout,

thanks & regards...
K.V.Ravindra Kumar

"Duron" wrote:
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="Def ault.aspx.vb" Inherits="MySit e._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*******@disc ussions.microso ft.com>
:D8************ *************** *******@microso ft.com...
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>.Defaul t" 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!


Nov 18 '05 #8
"Duron" <jo*********@se ed.net.tw> wrote in message
news:Os******** *****@tk2msftng p13.phx.gbl...
Hi Ravindra,

I've done some more tests. Here are something I found,

First, if I simply create a new folder, say Member, and then add a new web
page, say Default.aspx, it is working fine, no matter if there is another
Default.aspx at the root.

Then, I copied Web.config into /Member. After this, if I try to run
/Member/Default.aspx, an error message says I have to make this folder an
web application in IIS. I did so. But then the old error (can not load
namespace MySite._Default ) occurs.

I haven't done many things to Web.config except the following,

<authenticati on mode="None">
</authentication>
<authorizatio n>
<allow users="*" />
</authorization>

The reason why I add Web.config to that folder is because I want the root
folder be free to access while /Member needs certification. How do people
normally do this in VS.NET?


People normally use <location> tags.
--
John Saunders
johnwsaundersii i at hotmail
Nov 18 '05 #9
> "Duron" <jo*********@se ed.net.tw> wrote in message
Then, I copied Web.config into /Member. After this, if I try to run
/Member/Default.aspx, an error message says I have to make this folder an web application in IIS. I did so. But then the old error (can not load
namespace MySite._Default ) occurs.

I haven't done many things to Web.config except the following,

<authenticati on mode="None">
</authentication>
<authorizatio n>
<allow users="*" />
</authorization>

The reason why I add Web.config to that folder is because I want the root folder be free to access while /Member needs certification. How do people normally do this in VS.NET?


I could be wrong (ultranewb, here), but I believe the reason you're getting
an error message that says you have to 'make the folder an application' in
IIS is because you're trying to specify authentication again in your second
web.config file. Authentication can only be set in the web.config file in
the root directory, as it pertains to the whole application. So just remove
the <authentication > tag pair from the config file in the subdirectory and
everything else should be fine - the authorization section does the work you
need. Or you can, as was suggested, use 'location' tags in a single
web.config file at root.

HTH

-John
Nov 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3687
by: Jagdeesh | last post by:
Hai Colleagues, I am using Tomcat 4.1.24 and JDK 1.4.0_03 in my winXP machine. I've transferred a set of folders(containing jsp files) into tomcat's webapps directory(to /webapps/bob , /webapps/sue) and i have added the folders bob, sue in my server.xml(in the context path). When i am trying to run jsp files from my browser, it works fine. But, the following jsp files reports some exceptions which is quite hard to understand. Here is...
2
828
by: Gustavo L. Fabro | last post by:
Greetings. I had an user control built on Visual Studio 2003 that I used in some forms build also with Visual Studio 2003 (C++ was the language for both cases). Now I'm trying to port this to VS 2005. The forms that use these specialized ..NET /CLR compiled controls will compile and run, but won't show in the Design editor. What happens is that when I double click the .h file to open it under the
6
4753
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
5
2491
by: Manish Jain | last post by:
Environment: Windows 2000 Server (SP4), ASP.Net/C# (Framework 1.1) Hardware: PIII @ 700 MHz, 512 MB RAM ---------------------------------------------------------------------------- ------------------------------------------------------- I have developed a web application which I am deploying on above mentioned environment. Problem is that when I run it for the first time after a Build, then there is too much of CPU hogging. The Task...
0
1555
by: RK | last post by:
Hello I am using Microsoft Development Environment 2003 Version 7.1.3088 & Framework 1.1.4322 and developing Windows Forms using Visual C#. It was working fine for quite a month. Currently while opening the c# project the designer started giving lot many errors. The compiled exe, before the last project closing is still working as desired. The following are the problems. 1. A class file shows error in the Solution Explorer, also...
5
1699
by: David | last post by:
I'm developing an ASP.NET application to run on Win2K server with IIS 5.1, which has run perfectly happily in various development, test and staging environments. I've recently deployed it on one of our production servers and I'm getting an intermittent 'Access is denied' error when pages are loading. The file being accessed is an xml globalisation file that is used to load the text for the page according to the language settings of the...
2
3734
by: moondaddy | last post by:
I have a simple sample site I'm building in asp.net 2.0. I created a master page and a default.aspx content page in the project's root directory. Then I created a subfolder called content and added some aspx pages in the 'content' folder. when these pages were created I referenced the master page so everything should be linked up OK. Now, back on default.aspx I added a linkbutton and referenced one of the aspx pages in the 'content'...
1
1751
by: Nathan Sokalski | last post by:
I am revieving the following error for one of my controls when loading any pages that use it: Server Error in '/exposure/app' Application. -------------------------------------------------------------------------------- Parser 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.
8
12784
by: ajos | last post by:
hi frnds, the situation is im developing a web application in struts-- my specifications-eclipse3.2.2,struts1.1,tomcat5.5.23 mysql5.0 db. the scenario-i have a jsp page which adds the records in the db.when the user clicks submit,a javascript gets fired and checks the validation.on submit the BdgMastAction.java does all the data access and forwards the control to a jsp named bdgm.jsp.the results are displayed in the jsp.the values...
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.