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'.
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 { } } } }
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.
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.
If you create your application as Website then the Page directive is CodeFile
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With