How do I pass some additional properties to an EditorTemplate
?
I want to use it like this (kind of pseudo code):
@Html.EditorFor(m => m.ReturnFlight, new { additionalViewData = new { FlightType = FlightType.Return } })
@Html.EditorFor(m => m.OutboundFlight, new { additionalViewData = new { FlightType = FlightType.Outbound } })
FlightTemplate:
<h1>FLight @Model.FlightNumber</h1>
@if(FlightType == FlightType.Outbound)
{
// Display stuff for outbound flights
}
else if(FlightType == FlightType.Return)
{
// Display stuff for return flights
}
@Form.TextboxFor(m => m.Destination)