My View is strongly typed to an ADO.NET Entity Framework class with a boolean property ShowMenu.
<%@ Page ... MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage(Of Thing)" %>
...
I want to do something like this on my Master Page...
<%@ Master ... Inherits="System.Web.Mvc.ViewMasterPage" %>
...
<div id="menu" runat="server" visible="<%= Me.Page.Model.ShowMenu %>">
<asp:ContentPlaceHolder ID="MenuContent" runat="server" />
</div>
But, I get this error:
'Model' is not a member of 'System.Web.UI.Page'
How can I access a View's Model from its Master Page?
Update
Oops:
Server tags cannot contain <% ... %> constructs.
Have to use If...Then instead.