Tuesday, 10 September 2013

Partial not displaying Model details

Partial not displaying Model details

I have a page called Launch.cshtml that has an attached ViewModel and I am
able to successfully view the properties of the model. Within my model I
have the following code:
<div class="nine columns">
@if(Model.HasSurvey == 1)
{
<div id="surveyPartial" style="display:none">
@Html.Partial("Survey")
</div>
}
<div id="sectionPartial">
@Html.Partial("Section")
</div>
</div>
In my launch page I am able to call:
if ('@Model.Course.CompletionTypeID' == 2)
but this call is null reference when in the partial
When my survey page launches in the same window as a partial I am unable
to retrieve the values in the Model which I still need. How can I pass the
model from the launch page to the survey partial?

No comments:

Post a Comment