What I thought should be pretty simple turned out to be a lot more.
Atm I use the base class (MasterModel) for all my models, which are then passed from ViewPage <HomeIndexModel> to ViewMasterPage <MasterModel> and everything works fine. This was done this way after reading the Scott Gu post.
Then I thought about inheriting from ViewPage and extending Factory, or where ViewPage was ever created ... but then I got lost.
Who is responsible for instantiating ViewPage, ViewMasterPage, and ViewUserControl.
The problem is more or less that I use an instance of one class on 99% of all pages and always on MasterPage, so its pain constantly transfers it to the model all the time.
Is this even the right way, or do you have other suggestions?
Update
I need to be able to inject complex types taken from my IOC (StructureMap) into the ViewPage constructor, so it will be easy to change the implementation. That is why I am looking for a place where ViewPage will be created.
Syska source
share