|I got an answer to my question, Return Current View From Different Controller (MVC Log On Control), and the comments aren't a very good place to discuss that, so I thought I'd bring the discussion here.
Keith Barrow wrote:That's the first problem, you should only re-direct if the login is a success.
Right, that was only there for demonstration purposes. The examples I was toying around with on my computer returned a variety of things, but I wanted to keep it simple.
Keith Barrow wrote:If the login fails you should return a view with the "failure" information
That is the idea. I currently have validation rules set on the model using attributes (e.g., [Required]). The idea is that the validation summary will display that, but the exact method I use to display failure info is only of ancillary importance.
Keith Barrow wrote:there is no way to send the information safely to the client without encryption (even ViewState can be read)
The validation mechanism only needs the form data to validate against, and the result can be constructed based on the success or failure of the validation.
Keith Barrow wrote:Anyway, having done this, if you try and navigate to /home/index you'll get the login page and the Query string posted back to the server will have /home/index as the target
Right, I already know how to do that. The whole point of my question is how to avoid having an extra page. I want the login control to be inline on all pages (or most, at least). And I want it to be inline after postback (that is, I don't want the URL to change). And I don't want to use AJAX (that's probably my only real solution, but I'm trying to find a more "pure" solution).