I have a page with multiple forms which can be handled by different actions and controllers. When submitting form with wrong data action method have to render the entire initial page + error messages. I'm facing the problem when action method which is responsible only for his own small task have to deal with rendering the entire initial page in case of error.
I see two ways to deal with it:
- use ajax/client-side validation - avoid page refresh
- extracting code for building view model into separate layer and sharing it across multiple controllers and actions
..and I don't like none of them. Do you know any other ways of minimizing efforts to render entire initial page in case of errors?