MVC helper functions business logic

Posted by Menelaos Vergis on Programmers See other posts from Programmers or by Menelaos Vergis
Published on 2014-08-22T07:08:00Z Indexed on 2014/08/22 10:27 UTC
Read the original article Hit count: 282

Filed under:
|

I am creating some helper functions (mvc.net) for creating common controls that I need in almost every project such as alert boxes, dialogs etc.

If these do not contain any business logic and it's just client side code (html, js) then it's ok. My problem arises when I need some business logic behind this helper.

I want to create a 'rate my (web) application' control that will be visible every 3 days and the user may hide it for now, navigate to rate link or hide it for ever.

To do this I need some sort of database access and a code that acts as business logic. Normally I would use a controller for this, with my DI and everything, but I don't know where to put this code now.

This should be placed in the helper function or in a controller that responds objects instead of ActionResults?

© Programmers or respective owner

Related posts about mvc

Related posts about asp.net-mvc-3