tags:

views:

38

answers:

1

How can you access a PartialView's model, in a View which implements that PartialView?

I'm thinking something along the lines of: Page.FindControl("PartialView-name").Model.

+1  A: 

A partial view (.ascx) is included from a view (.aspx). If this partial is strongly typed you pass the model from the view so you already have access to it:

<% Html.RenderPartial("~/Views/Shared/SomePartial.ascx", SomeModel); %>
Darin Dimitrov
Bad design on my side of things, and too quick to turn to SO :)
roosteronacid