For whatever reason my .aspx will only recognize the code behind when the Page directive is using CodeFile and not CodeBehind. Also, it gives a parser error on runtime. But I need CodeBehind to publish the site.
- Every other page in the web application uses CodeBehind.
- I've tried deleting and recreating the file, even leaving it empty, still an error.
- I've tried deleting the designer file and converting the .aspx to a web application.
- The page directive references (namespace, class) are correct.
- Tried deleting the obj.
- Tried cleaning and rebuilding.
I'm out options here. Everything I've googled so far hasn't panned out. Why can't CodeBehind be used?!
.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/App/Masters/Default.Master" AutoEventWireup="true" CodeBehind="BlogPost.aspx.cs" Inherits="WebApplication.App.Templates.BlogPost" %>
.aspx.cs
namespace WebApplication.App.Templates
{
public partial class BlogPost : BaseTemplate
{