Using Request inside Actions: why it is a bad idea
Posted by: Code Climber,
on 05 Jun 2009 |
View original | Bookmarked: 0 time(s)
Why cant I use Request["id"] inside an action to get the value of the query string parameter named "id"? I was asked this questions millions of times in the talks I did about ASP.NET MVC during the last months. I also got it asked a few times from colleagues so, when yesterday a friend asked the same question on a comment on one of my latest posts, I decided that the time had come to try and clarify this with a post. The quick answer is: Because you dont want to have a dependency on the environment,...