My error handling collects (some manually, some automatically) the errors produced during controller execution. Then I have a partial view which renders out the error messages. I store the error messages in ViewData (and transfer them to TempData if I respond in a RedirectResult).
The problem is: if a child action causes an error it will not get displayed, as they (at least the ones further down the page) are executed AFTER the partial view is rendered.
Right now the only, somewhat desperate idea I have is to render the messages into javascript at the bottom of the layout page, and have that javascript update the error display boxes. But it smells bad, I shouldn't need client-side code for this.
Is there a way to have a partial view "lazy rendered", after everything else?