I have a controller with two methods:
Index()
, that loads the model with data from DB.GetFile()
, that returns a file for the user to download.
If GetFile()
fails, I want to return to the view, with an errormessage. I am NOT sending the model from the View to the controller-method GetFile().
My problem is:
- If I want to return to the view from GetFile(), I will have to initialize the model and call the DB for the data. In my eyes, this is a waste of resources and should be avoided.
My question: is there a way to return to the View, without initializing the model again (call DB)