I have some plain Views, they don't have any logic behind them (there is no action or controller behind them), their only propouse is to alert the user about something like "We have sent you an email to confirm your account", "You have no access to this resource", etc...

These views are really simple, and calling them through a Controller/Action seems to be too much overhead, but somehow I feel like it is not quite correct. What do you think? How do you handle this kind of situations??

I guess this question will apply to any MVC Framework, but in my case I'm using the ASP.NET MVC 3 framework.

  • 1
    Controller can control multiple views. Jun 2, 2012 at 9:03

3 Answers 3


In my 'view' everything needs to go through the controller. When you break the design pattern, even for something simple, you're asking for chaos as the app evolves over time. Ask anyone who's still having to work on 10-12 year old apps where a 'simple' change in 2002 is now a nightmare to deal with in 2012.

In .NET MVC3 you can use partial views to handle some informational widgets as well as JQuery. Which to use will depend on where you want to separate server and client side interaction.

To take it further, you might want to use an Alert view model and have your view (or partial) adjust accordingly. For example, I use a LinkSelectList viewmodel to hold values for a list of links matching search criteria. I use this in several places in an app where the user can search for different items.


They do have logic "behind" them.

They only came up as the result of certain actions, like "Done, email me and send me a confirmation." As that email action is being done in a controller, the controller then directs to the final view.

If you just want pop-ups for acknowledgment messages, like the ones that appear and then disappear automatically, that's different and you can use Javascript and libraries like jQuery for that.


But your controller must first find out if those messages are valid.

"We have sent you an email to confirm your account" makes only sense, if an email was sent without errors.

"You have no access to this resource" is something the view can't and should not know. It needs to ask the controller to send the resource. Even the controller should know nothing about access permissions, but has to ask the model. Only after the model found this out, i can respond either with the resource or the error message.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.