This is specifically for Visual Studio 2015.
In my Site.master I have
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="~/Site.master.cs" Inherits="SiteMaster" %>
<asp:Literal ID="Literal1" runat="server" />
And in my Site.master.cs I have
Literal1.Text = "test";
In addition in Site.master.cs I have
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebMatrix.Data;
public partial class SiteMaster : MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
Literal1.Text = "test";
}
And it won't build. I get the error:
error CS0103: The name 'Literal1' does not exist in the current context.
There is no designer file. I don't know how to get the designer file back for VS2015. I've tried several older suggestions from previous versions of VS. I'd like to get it to build whether I need a designer file or not.