473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Organizing pages in subdirectories of main directory

At the moment I'm an asp.net rookie. I'm using Visual Studio .net 2003.
I get the error "An error occurred during the parsing of a resource required...
Could not load type 'myApp.main'.

This error occurs in pages located in a subdirectory beneath the root level in my application. So for example I want to create a folder called pages and then place content in this subdirectory so that I can secure those pages using a web.config file.

Do I need to change the line below in some way, or do I need to change something elsewhere
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="main.aspx.vb" Inherits="myApp.main"%>
Nov 18 '05 #1
4 2090
Try compiling your web application. When a web application compiles, an
assembly binary is created from the code-behind pages. It could be that the
system does not have a knowledge of the myApp.main in the assembly.

"Charlie Dison" <ch****************@vitalworks.com> wrote in message
news:56**********************************@microsof t.com...
At the moment I'm an asp.net rookie. I'm using Visual Studio .net 2003.
I get the error "An error occurred during the parsing of a resource required... Could not load type 'myApp.main'."

This error occurs in pages located in a subdirectory beneath the root level in my application. So for example I want to create a folder called
pages and then place content in this subdirectory so that I can secure those
pages using a web.config file.
Do I need to change the line below in some way, or do I need to change something elsewhere? <%@ Page Language="vb" AutoEventWireup="false" Codebehind="main.aspx.vb"

Inherits="myApp.main"%>
Nov 18 '05 #2
Are you using the correct namespace/class names? "myApp.main" should always
change to reflect the Namespace.Class of the code-behind class.

"Charlie Dison" <ch****************@vitalworks.com> wrote in message
news:56**********************************@microsof t.com...
At the moment I'm an asp.net rookie. I'm using Visual Studio .net 2003.
I get the error "An error occurred during the parsing of a resource required... Could not load type 'myApp.main'."

This error occurs in pages located in a subdirectory beneath the root level in my application. So for example I want to create a folder called
pages and then place content in this subdirectory so that I can secure those
pages using a web.config file.
Do I need to change the line below in some way, or do I need to change something elsewhere? <%@ Page Language="vb" AutoEventWireup="false" Codebehind="main.aspx.vb"

Inherits="myApp.main"%>
Nov 18 '05 #3
Can you explain in a little more detail how I should check my namespace/class names? What action should I take to check this? Thanks in advance.
Nov 18 '05 #4
Hello Charlie,

Thanks for posting in the group.

Based on your description, it seems that VS.NET IDE can't find myApp.main
when compiling your project.

Generally speaking, "Inherits" attribute identifies the class from which
the page derives. In Visual Studio, this points to a class in the project
assembly (.dll), as shown in the diagram above.

I tested it on my side as you described. Here are my testing steps:

1) Create a web application on local machine named WebApplication2.
2) The Page directive of default web form WebForm1.aspx is:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="WebApplication2.WebForm1" %>
3) Create a subfolder named NewFolder1 by right click project
name(WebApplication2)->Add->New Folder in Solution Explorer.
4) In the subfolder, create a new web form named Webform1.aspx also.
5) The Page directive of WebForm1.aspx in the subfolder is:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="WebApplication2.NewFolder1.WebForm1" %>

So I think you may need to change Inherits attribute to
"myApp.SubFolderName.main"

If the problem still can't be resolved, could you please post here step by
step how you create this asp.net web application here? So we could tell
which step may contain errors.

If there is anything unclear, please feel free to post here. Thanks.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 18 '05 #5

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

Similar topics

1
by: Thieum22 | last post by:
Hi, I try to go through a directory and it's subdirectories to reah the properties of each files. But I have a problem to set active the directory where the files are, in order to display their...
3
by: Jamie | last post by:
Hi, Thanks for the excellent answer to my last question! One more: Does anyone have a method they follow for organizing stylesheets themselves? They seem like they can get bloated and hard to...
6
by: Dean | last post by:
I have several ASP.NET applications that I want to put onto a new website. Each app is currently its own solutions with it's own global.asax, etc.. What is the right way to deploy multiple...
2
by: Andre | last post by:
I've got the basic forms based authentication going. A user has to go to my login page before they can access any other pages. The issue is that there are a sub-set of pages on which I don't...
3
by: Brian F | last post by:
Ok here goes: WEBSITE main directory allows anonymous users fine. SITEA, SITEB, and SITEC are all subdirectories under WEBSITE that refer to graphics and javascript in the main virtual...
1
by: Benton | last post by:
Hi there, I want to have an unrestricted root directory and some protected subdirectories on my ASP.NET 2.0 application. I want each subdirectory to have its own Login.aspx page. The...
1
by: KidQuin | last post by:
I am having problems with session value between pages. Happening in both firefox and IE7. I go between page by links so I know it's not header changes. I use session_start as the first line on the...
5
by: ivarnelispam | last post by:
Hello all, I'm starting work on what is going to become a fairly substantial Python project, and I'm trying to find the best way to organize everything. The project will consist of: - A few...
4
by: Laharl | last post by:
My Operating Systems professor has assigned homework that basically boils down to implementing ls -lra, but with a different output format. In other words, list the files and subdirectories (and a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...

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.