Please can anybody point out where this code might be going wrong. I am trying to create a partial class for the masterpage.
The master pages class:
namespace MuniWeb.Models.SiteMaster{
public class BaseViewData
{
public string Title { get; set; }
public string MetaKeywords { get; set; }
public string MetaDescription { get; set; }
}
public partial class Site : System.Web.Mvc.ViewMasterPage<MuniWeb.Models.SiteMaster.BaseViewData>
{
public Site()
{
ViewData.Model = new BaseViewData();
}
}}
The master page:
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage<MuniWeb.Models.SiteMaster.BaseViewData>" %>
The error:
Object reference not set to an instance of an object.
Line 33: <div id="footer">
Line 34: ApplicationID:
Line 35: <%= Model.Title %>
Line 36: </div>
Line 37: </div>
I am just using this as an example. The code I want to use needs to fire for every page to check certain parameters, this is why it is in the master page.