We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e.g. something like this, maybe add a BeginChameleonForm overload that takes the model type as a shorthand too...
BeginChameleonForm
public static class HtmlHelperExtensions { public static HtmlHelper<TNewModel> ForModel<TNewModel>(this HtmlHelper html, TNewModel modelInstance = default(TNewModel)) { var tempDataDictionary = new ViewDataDictionary(html.ViewContext.ViewData) {Model = modelInstance}; var newViewDataDictionary = new ViewDataDictionary<TNewModel>(tempDataDictionary); var newViewContext = new ViewContext( html.ViewContext.Controller.ControllerContext, html.ViewContext.View, newViewDataDictionary, html.ViewContext.TempData, html.ViewContext.Writer ); var newViewData = new ViewPage<TNewModel> { ViewContext = newViewContext, ViewData = newViewDataDictionary }; newViewData.InitHelpers(); return new HtmlHelper<TNewModel>(newViewContext, newViewData); } }
The text was updated successfully, but these errors were encountered:
Added HtmlHelper extesions for creating dependent HTMLHelper against …
736ccaa
…sub-property or a random model type (with and without instance) Partially addresses #95 and #107
Added overload for Html that creates form against random model type
12db224
Fixes #95
8247c55
8602499
No branches or pull requests
e.g. something like this, maybe add a
BeginChameleonForm
overload that takes the model type as a shorthand too...The text was updated successfully, but these errors were encountered: