Upload master page problem...
Hi,
I had a web site with MasterPage and I am trying to use that MasterPage by upload to a newly created project Sitefinity. I had a problem that when I uploaded I got an error it Said "Could not load type 'MasterPage'"
Here is error:
Server Error in '/CMSSite' 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 'CMS_MasterPage'.
Source Error:
Line 1: <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="CMS_MasterPage.master.cs" Inherits="CMS_MasterPage" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Source File: /cmssite/App_Master/CMS_MasterPage.Master Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
Hi NK,
The problem is because the CodeBehind file is not built. If you want to use CodeBehind you should first build it into an assembly and then reference it from the master page as you are. This is an old .NET concept. The newer one is to use CodeFile. Works the same way, however is compiled at run time you do not need to build it into your own assembly.
If you are working with Sitefinity 4.0 as the website is a web application you should always build the project when you make code or markup changes.
Regards,
Radoslav Georgiev
the Telerik team
It worked.
Thanks,