Posted on 25/05/2016 11:06:31
Hi Mikkel
Well, yes you can access everything using the Dynamicweb API from any controller. Not sure why you would do that in your controller though... But anyways. See dump.
If you create a ProductListController - you would create a model for use with the view that you return by that controller. If you do that, you have to do everything by hand - you kind of bypass the entire frontend of Dynamicweb and all the logic that handles i.e. a list of products. It makes no sense.
You would use ASP.NET MVC with Dynamicweb if you have something completely custom sitting on the 'side' or being used for administration of a custom module (we also use MVC for some stuff in DW).
The Dynamicweb frontend is a "controller" itself (PageView - not asp.net MVC controller, but our own concept of it) and has the models (Template instances) - it is generic and you access it through @GetValue (or even @Model). Agreed it is not ASP.NET MVC.
In DW9 we introduce the concept of @Model in templates, that would give you partially type strong models (not including items, custom fields etc that are defined after the model is compiled)
I'll be happy to spend an hour with you to talk about this.
BR Nicolai