I have a single page with a Partial control on it called PartialContact
In reusing this control I would like to change the title within the PartialContact control. i.e.
// change to Title1
@Html.EditorFor(model => Model.Contact1, "PartialContact")
// change to Title2
@Html.EditorFor(model => Model.Contact2, "PartialContact")
// change to Title3
@Html.EditorFor(model => Model.Contact3, "PartialContact")
Whats the best way to pass in title text within Razor? TempData?
(I have multiple different controls I need to do this with aswell)
Many thanks
Chris
Use the ViewDataDictionary to pass the value, e.g.
Then access it in the partial with
@ViewData["Title"]