ASP.NET MVC - Typesafe Html.TextBoxFor with different outputmodel
- by BjartN
My view uses ModelX to render my HTML form and my controller action takes ModelY as input when saving the form. It seems the typesafe textbox API assumes I am using the same model in both places.
Is it possible to use different models and beeing type safe without creating my own helpers ?
<% = Html.TextBoxFor(x => x.Text) %>
I would like something like this. Does it exist ?
<% = Html.TextBoxFor<InputModel,OutputModel>(input=>input.Text, output=>output.SomeOtherText)