ASP.NET MVC re-factoring
b# - Controller is NOT the New Code-Behind: ""
Ben has a great example of how things can get out of control even in a framework designed to simplify your code. I agree with his point and one of the MVC developers responds in his comments. So it looks like the issue will get taken care of quickly, if it hasn't been already.
I wanted to point out one bit that I saw that maybe needs re-factoring. It was in the original code and the re-factored portion that Ben posted.
-
if (Request.HttpMethod != "POST")
-
{
-
return View();
-
}
Now I'll speak from ignorance for a second since I haven't gotten to look at the MVC code since preview 2. (Just too busy, busy with a new job). It seems to me that these lines could pop up in a lot of places in your MVC application. It would be nice if we could mark certain methods as POST or GET only. Maybe when defining the route. There may be a way to do this already in the routing system.



Pingback: ASP.NET MVC Archived Blog Posts, Page 1