Vulnerability in EPiServer.Forms
Being fairly new to MVC and also new to a higher version if CMS than 6 R2 I asume this is a nooby question.
I have a PageType called called EducationList with just two simple string properties, Header and Body.Under the Body I want to present a list of educations that comes from a whole other database. Actually a service with a nice model structure but not at all related to EpiServer.
In my EducatioListController I can easily get an object from the external service but how do I get that to show in the view (EducationList/Index.cshtml). The view only seems to be able to read things from the PageType Model and going via the ViewBag doesn't seem like a very elegant idea.
So... now what, is this were a View Model should be used or something else I have no clue about? I can't find any MVC tutorials on this including an EPiServer angle.
I actually solved it via a ViewModel combining the currentPage with my external service data and setting the properties of my new ViewModel and then setting my cshtml to have the ViewModel as model instead, yay!
Sounds like you took the right turn yes :)
There are a few examples in alloy project for extending viewmodels with custom properties...