Render MVC ViewModel without turnkey
No edit summary
(Automatically adding template at the end of the page.)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
MDriven Turnkey does a lot to get a seamless environment for application development.
MDriven Turnkey strives to create a seamless environment for application development. If you would like to use parts of the functionality and render a specific ViewModel from MDriven Framework MVC projects, you can do so.


If you would like to make use of parts of the functionality and render a specific viewmodel from MDriven Framework MVC projects you can do so.
A good way to get started with this is to look into the MDriven Turnkey View called Turnkey/Views/Turnkey/GenericView.cshtml


A good way to get started with how to do this is to look into the MDriven Turnkey View called Turnkey/Views/Turnkey/GenericView.cshtml
The trick is to make your MVC model of type VMClass -> @model VMClass.  


The trick is to make your MVC model of type VMClass -> @model VMClass, you can then use this construct to render the ViewModel UI:
You can then use this construct to render the ViewModel UI: '''@Html.Partial(Html.RazorPartialFile());'''
 
* To get the actions for the left side: '''@Html.DisplayLeftSection()'''
@Html.Partial(Html.RazorPartialFile());
* To get broken constraints: '''@Html.ValidationSummary(true)'''
 
* To create VMClass instances, use: '''Eco.ViewModel.Runtime.ViewModelHelper'''
In order to get the actions for the left side: @Html.DisplayLeftSection()
 
To get broken constraints: @Html.ValidationSummary(true)
 
To create VMClass instances you use Eco.ViewModel.Runtime.ViewModelHelper
[[Category:MVC]]
[[Category:MVC]]
[[Category:MDriven Turnkey]]
[[Category:MDriven Turnkey]]
{{Edited|July|12|2024}}

Latest revision as of 15:45, 10 February 2024

MDriven Turnkey strives to create a seamless environment for application development. If you would like to use parts of the functionality and render a specific ViewModel from MDriven Framework MVC projects, you can do so.

A good way to get started with this is to look into the MDriven Turnkey View called Turnkey/Views/Turnkey/GenericView.cshtml

The trick is to make your MVC model of type VMClass -> @model VMClass.

You can then use this construct to render the ViewModel UI: @Html.Partial(Html.RazorPartialFile());

  • To get the actions for the left side: @Html.DisplayLeftSection()
  • To get broken constraints: @Html.ValidationSummary(true)
  • To create VMClass instances, use: Eco.ViewModel.Runtime.ViewModelHelper
This page was edited 95 days ago on 02/10/2024. What links here