Question

The question is simple. Let's say I have a model. I need default data to be loaded into the model on first page load. Where do I do this? I thought on performing the data load overriding the OnInit event but then the Presenter is not available by the time that event is being fired.

Any recommendations? I'm doing it by overriding the OnLoad method but for some reason the method is called twice, and loads the data twice as well.

Was it helpful?

Solution

You shouldn't need to override the OnLoad method, you should be attaching to the load event in the presenter. Populate the Model in the presenter in the load event. If you're overriding the built in methods you're not using the MVP framework as it's intended.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top