Okay, I had never used .Net at all (although I have used ASP for about a year), so I decided to download .Net 2/VWD.
I have created a page in VWD and it builds fine, and runs fine on my local PC. I decided to setup a test server, so I have a box next to mine, with a fresh install of Windows Server 2003 Standard. I installed IIS, and .Net 2 on there also.
I used Website > Copy website... in VWD to move the files over to the other box, but when I run the page I get:
Server Error in '/' 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.
Parser Error Message: Could not load type 'MasterPage'.
Source Error:
Line 1: <%@
Master Language="C#"
AutoEventWireup="true"
CodeFile="MasterPage.master.cs"
Inherits="MasterPage" %>
Line 2:
Line 3: <!DOCTYPE
html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Source File: /MasterPage.master Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.40607.42; ASP.NET Version:2.0.40607.42
Try deleting the code file and delete the reference of the codefile and the ClassName from the masterpage code. Will look as below.
<%
@ Master Language="C#" AutoEventWireup="true" %>
rmb82
Member
25 Points
5 Posts
Parser Error Message: Could not load type 'MasterPage'
Jun 27, 2005 08:24 PM|LINK
I have created a page in VWD and it builds fine, and runs fine on my local PC. I decided to setup a test server, so I have a box next to mine, with a fresh install of Windows Server 2003 Standard. I installed IIS, and .Net 2 on there also.
I used Website > Copy website... in VWD to move the files over to the other box, but when I run the page I get:
Server Error in '/' 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.
Parser Error Message: Could not load type 'MasterPage'.
Source Error:
Line 1: <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Source File: /MasterPage.master Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.40607.42; ASP.NET Version:2.0.40607.42
MorningZ
Star
8849 Points
1822 Posts
Re: Parser Error Message: Could not load type 'MasterPage'
Jun 27, 2005 10:09 PM|LINK
might want to name the .master something other than "MasterPage", which is already a type in .NET
its always a good idea to avoid words that are already objects in the framework
rmb82
Member
25 Points
5 Posts
Re: Parser Error Message: Could not load type 'MasterPage'
Jun 28, 2005 07:47 PM|LINK
2/ Someone in another thread, said I needed to compile the app - but I don't see an option for this?
MorningZ
Star
8849 Points
1822 Posts
Re: Parser Error Message: Could not load type 'MasterPage'
Jun 29, 2005 11:55 AM|LINK
its the "Build Web" option under the "Build" toolbar item
akhi4akhil
Member
30 Points
16 Posts
Re: Parser Error Message: Could not load type 'MasterPage'
Oct 08, 2009 10:15 AM|LINK
Try deleting the code file and delete the reference of the codefile and the ClassName from the masterpage code. Will look as below.
<%
@ Master Language="C#" AutoEventWireup="true" %>
Regards
Akhil
Mark as answer if helpfull. :)
Akhil
Mark as Answer if found helpfull.
hims.aspnet
Member
403 Points
101 Posts
Re: Parser Error Message: Could not load type 'MasterPage'
Oct 08, 2009 11:00 AM|LINK
Rename the masterpage file to any other name except MasterPage.master e.g. MasterPage1.master
Change the page directive in MasterPage1.master as
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage1.master.cs" Inherits="MasterPage1" %>
and then change class name in the MasterPage1.master.cs file as MasterPage1.
Please check if it helps then mark as answer.
yoursbangaru...
Member
2 Points
3 Posts
Re: Parser Error Message: Could not load type 'MasterPage'
Oct 29, 2009 05:29 AM|LINK
Trisas Solutions Pvt.ltd