page 1 of 1
Comments: 0 | Views: 771
stevo_
stevo_
Human after all
I'd post this to the codeplex site for it but I cannot ever seem to sign in to the site.. basically I have two nested strongly typed master pages:

master a
- master b

a is strongly typed to class ViewA, and b is strongly typed to class ViewB, ViewB inherits from ViewA.

Basically I have this code in master b:

<asp:Content ContentPlaceHolderID="MainContent" runat="server">
    <asp:ContentPlaceHolder runat="server" ID="MainContent" />
    <%= this.Model.Cart %>
    <% Html.RenderPartial("CartSummary", this.Model.Cart); %>
</asp:Content>

You might wonder, whats the point in the third line, where I write out the Cart property.. well, this is the thing, if I remove it, the page errors in the designer (as well as when running), stating that the on the method RenderPartial, the property Cart does not exist on object Model..

I get the feeling this is something to do with the 'hackery' thats done to get strongly typed views without code behind files, just wondering if anybody has come across this.. just to note the master pages are typed by doing the following (for example):

<%@ Master Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewMasterPage<ViewB>" %>

Cheers guys, if anybody can replicate perhaps you could report it on the codeplex site.

Edit: just to clarify, when I remove the line, if I inspect the Model property, its type appears as 'object'.
page 1 of 1
Comments: 0 | Views: 771
Microsoft Communities