473,385 Members | 1,615 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.

Parser Error Message: Could not load type

OuTCasT
374 256MB
Ive created a new page in my website project.
Now I have used a master page as follows
Expand|Select|Wrap|Line Numbers
  1. <%@ Page MasterPageFile="[ProjectName].master" %>
To use codebehind i have added this to the string

Expand|Select|Wrap|Line Numbers
  1. <%@ Page MasterPageFile="[ProjectName].master" CodeBehind="registerbusiness.aspx.vb" Inherits="[ProjectName].registerbusiness" %>
When i run the project i get this error:

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.

Parser Error Message: Could not load type '[ProjectName].registerbusiness'.
Could you inform me why I would be getting this error.
Nov 10 '09 #1
5 4397
Frinavale
9,735 Expert Mod 8TB
Just so you know, what you have as [ProjectName] is actually the Project's Namespace. By default the namespace for the project is the same name as the project; however this can be changed, so the ProjectName does not always match the Project's Namespace.

Anyways, your @Page directive should look something like:

Expand|Select|Wrap|Line Numbers
  1. <%@ Page MasterPageFile="[relative path to the master page]"
  2.                   CodeBehind="registerbusiness.aspx.vb"
  3.                   Inherits="[ProjectNamespace].registerbusiness"
  4.                   Language="vb"
  5. %>
When you look at code implementation found in your registerbusiness.aspx.vb you should see the a Partial Class with the same name as specified in your @Page directive's Inherit attribute. If this name is different then it won't work. If the partial class is in a different namespace, then it won't work either.

Here's an example of the @Page directive for a page that uses a MasterPage (located in the root of the project) from my project:

Expand|Select|Wrap|Line Numbers
  1. <%@ Page MasterPageFile="~/MasterPage.master"
  2.                   CodeBehind="Default.aspx.vb"
  3.                   Inherits="TestProject.Default"
  4.                   Language="vb"
  5. %>
And the VB.NET code in the Default.aspx.vb file looks like:
Expand|Select|Wrap|Line Numbers
  1. Partial Public Class Default
  2.     Inherits System.Web.UI.Page
  3. '......
  4. '......
  5. End Class
The default namespace (for the project) is automatically applied to the Default partial class.

-Frinny
Nov 10 '09 #2
OuTCasT
374 256MB
Here is my masters page
Expand|Select|Wrap|Line Numbers
  1. <%@ Master Language="VB" AutoEventWireup="false" CodeBehind="CreativeHearts.master.vb" Inherits="Creative_Hearts_2._0.CreativeHearts" %>
And here is my code for my RegisterBusinessLogin.aspx page
Expand|Select|Wrap|Line Numbers
  1. <%@ Page MasterPageFile="Creativehearts.master" CodeBehind="registerbusinessLogin.aspx.vb" Inherits="Creative_Hearts_2._0.registerbusinesslogin" %>
Nov 11 '09 #3
Frinavale
9,735 Expert Mod 8TB
It sounds like you haven't done a lot of work on the page that's using the master page yet.

Try adding a new page that uses master the master page:
  • Right click on the solution in the solution browser
  • Click on Add -> New Item
  • Choose Web Content Form and give it a name
  • Click the Add button
  • Click the Master Page that you want the new web/content form use
  • And click OK


This will give you a page that should work properly.
Nov 11 '09 #4
OuTCasT
374 256MB
I think that somewhere along the line i accidently renamed the project and then renamed it back again. Because when I add a fresh webform and i dont reference my master page then i get the same error message.

I just redone the project.
Nov 12 '09 #5
Frinavale
9,735 Expert Mod 8TB
Oh this is a website not a web application.
Try removing the Namespace from the page directive...see if that helps?
Nov 12 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: ST | last post by:
Hi, I keep getting the parser error, and I have no idea why. I've tried a number of things including: 1)building/rebuilding about 100x 2)making sure all dll's are in the bin folder in the root...
2
by: BW | last post by:
When entering web site I get the following error in the Default.aspx page: Server Error in '/' Application. ---------------------------------------------------------------------------- ---- ...
2
by: Jerry Tovar | last post by:
I am using .Net 2003 on a XP Pro using IIS. My IIS is configured to have it's root on our Network drive. I have been able to create ASP.Net webform up until now. For what ever reason, I am...
2
by: mp | last post by:
I have aspx file VS.NET 2002 with c# My application works perfectly on my pc. Please, I need help... THANKS :) ============================= 1) I would like to know what is minimum files what I...
6
by: ST | last post by:
Hi, I keep getting the parser error, and I have no idea why. I've tried a number of things including: 1)building/rebuilding about 100x 2)making sure all dll's are in the bin folder in the root...
5
by: Kenneth P | last post by:
Hi, I get a Parser Error message when I try to start my asp.net app. Parser Error Message: Could not load type 'DiskoWeb.dLogin'. I have a code behind file and it's class name is dLogin. ...
2
by: Marshall | last post by:
Hi All, I am building an asp.net web app using Visual Studio 2003. Today I created a new folder called 'Secured' at the root of my web app so I could partition off all of the restricted...
2
by: 3Dfelix | last post by:
Hello, I'm starting with Visual Web Developper and ASP.NET 2.0. In order to test my remote server, I created an "hello word" aplication, that is working on local server. I have copied all...
3
by: Olav | last post by:
I get this error in the EventLog when I try to open an ASP.NET 2.0 web page. What should I look for to fix the problem? Olav Event code: 3006 Event message: A parser error has occurred....
0
by: Jonathan Crawford | last post by:
Hi I have had theis error four a week now. I am completely questioning my future as a ms programmer. As far as i am aware I have done nothing wrong. The site worked for 4 years in .Net 1 and iI...
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: 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?
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.