Does anyone know the proper syntax on how to specify the model that you are attempting to use for a specific view? In my application, I used the MVCScaffolding NuGet Package and when you scaffold something, it creates the CRUD views for you. Problem I’m having is that I wanted to have a partial view loaded on a parent’s view and cannot for the life of me get the syntax correct.
The MSDN reference for what I’m attempting to do is here:
I have a Category model and an Item model and I want to add Items to a category in the Category detail view. So, I was wanting to load the partial view _CreateOrEdit for the Item model in a dialog but cannot figure out the syntax for specifying a model.
Please help…
If your desire is to render a partial view, the method to use is RenderPartial.
EDIT:
Re-reading your question, is your question how to specify a specific model for your view returned within a controller? If so it would simply be something like this: