Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parser Error Message: Could not load type 'webmarketing'

After finishing the web application and publishing it online no matter I try I keep getting the following error, keep in mind that it runs locally as it should...

Parser Error Message: Could not load type 'webmarketing'.

enter image description here

I ran through that solution though supposedly I'm doing the same as the solution, yet I'm still facing the same issue...

ASP.NET Parser Error Cannot load code behind


Here is the code behind:

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls;  namespace webmarketing {     public partial class Masterpage : System.Web.UI.MasterPage     {         protected void Page_Load(object sender, EventArgs e)         {             string admin = (string)Session["Admin"];             if (string.IsNullOrEmpty(admin))             {                 logout.Visible = false;             }             else             {              }         }     } } 
like image 476
Mohammed Hanafy Avatar asked Apr 22 '14 12:04

Mohammed Hanafy


Video Answer


2 Answers

I had same problem before i just change CodeBehind to CodeFile and it worked.I remember it works in local but i had this problem after uploading.

like image 182
user3527150 Avatar answered Sep 22 '22 03:09

user3527150


This is normally happening when you copy files from a Web application projects to Website Project.

When you create a Web Application the Page directive is CodeBehind for the web pages. enter image description here

If you create your application as Website then the Page directive is CodeFile enter image description here

So if you copy from a Web application to Website the Namespace as well as the page directive will not change automatically, you should do this manually to rectify this error.

like image 37
Abhilash Thomas Avatar answered Sep 21 '22 03:09

Abhilash Thomas