If I have a model passed onto Index.cshtml
Can I modify a property on the model inside of a code block in Index.cshtml and then pass modified model into Html.Partial(“_MyView”, Model)
@model.Name = "Joe"
@Html.Partial("_MyView", Model)
@model.Name = "Ann"
@Html.Partial("_MyView", Model)
Sure you can; you just need to use the
Modelproperty, not the@modeldirective.