I've learnt tonight that ASP.NET MVC tends to get annoyed when you reuse a controller instance. I have a (rather primitive) factory creating controllers and doing some simple dependency injection. This is a result of a medium trust target environment. My first pass at a controller factory reused controller instances. This resulted in InvalidOperationExceptions with the message: The parameters dictionary does not contain a valid value of type 'System.Int32' for parameter 'id' which is required for method 'System.Web.Mvc.ActionResult EditPosting(Int32)' in '<MyController>'. To make a parameter optional its type should either be a reference type or a Nullable type....
Way back in the dark ages the world wide web was created as a means of sharing static content. For various good reasons HTTP was made a stateless protocol. This conserved server resources as a client only consumed scarce resources (such as memory and network connections) during the processing of the request. As the requests are bursty this allowed many more clients to use a server than in a more traditional network application where clients have persistent connections and tie up resources for long periods.
In the beginning this was fine but as people started to use it more this became...