user2103335
user2103335

Reputation: 63

Parser Error Message: Could not load type : the file of the master page

I have the following error in parsing my web - based application:

Parser Error Message: Could not load type 'Hamla.Masouma_Program'.

Source Error: 

Line 1:  <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Masouma_Program.Master.cs" Inherits="Hamla.Masouma_Program" %>
Line 2:  
Line 3:  <!DOCTYPE html>

My web based application has master page and this is the header of the master page:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Masouma_Program.Master.cs" Inherits="Hamla.Masouma_Program" %>

problem is that it can not load the code under inherits.

The page is working fine in the programming mode, but once I put in inetpub/wwwroot/ it does not work and gives this error. Can you please help me to fix this error.

BR//

Upvotes: 1

Views: 6573

Answers (2)

Ricardo
Ricardo

Reputation: 11

I had the same issue to after making some modifications on my proj. and now its online again; Instead of change the CodeBehind to CodeFile on your file.aspx, check Inherits;

On Inherits field:

Inherits="yourproject.yourfolder.yourfile"

one of my conf. file for ex:

Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RepConsult.aspx.cs" Inherits="Monit.Reporting.RepConsult"

In your case, you can try this:

CodeBehind="Masouma_Program.Master.cs" Inherits="Hamla.Masouma_Program.Master" %>

Upvotes: 0

Rick S
Rick S

Reputation: 6586

Read up on publishing ASP.NET websites. You're not putting the compiled version of your site in wwwroot, that's why you are getting that error.

http://msdn.microsoft.com/en-us/library/1y1404zt(v=vs.90).aspx

Upvotes: 3

Related Questions