I'm struggling to get FlashMessages working in the way I want: I am expecting that if I set messages in one action, when I visit (either directly or via a redirect) another action they should be displayed (given appropriate view code). I have put together a test project to show this:
https://gist.github.com/rogersillito/e1b84bd325611c04200e
Essentially, the only way I can get a flash message to display is by setting it in an action that returns a view, and then using the HtmlHelperExtensions method to display the messages within that view. Any attempt to set them in actions that redirect to such a view appear to cause the session contents to be lost?
I'm struggling to get FlashMessages working in the way I want: I am expecting that if I set messages in one action, when I visit (either directly or via a redirect) another action they should be displayed (given appropriate view code). I have put together a test project to show this:
https://gist.github.com/rogersillito/e1b84bd325611c04200e
Essentially, the only way I can get a flash message to display is by setting it in an action that returns a view, and then using the
HtmlHelperExtensionsmethod to display the messages within that view. Any attempt to set them in actions that redirect to such a view appear to cause the session contents to be lost?