Contents tagged with asp.net mvc
-
Custom Authentication with MVC 3.0
During a friendly code review discussion a week or so ago I realized I’d forgotten my favorite lore of custom authentication/authorization functionality in lieu of ASP.NET P&M. Though I definitely prefer P&M to rolling my own from scratch to the extent that I’ve gone as far as to use it as a pass-through there are some times when P&M is too much – or too little – so custom schemes must be developed. The thing that surprises me each time I observe a custom scheme is the lack of usage of the IPrincipal/IIdentity interfaces. With MVC 3.0 as my major weapon of choice in web development and my recent adoption of P&M, it became obvious that an opportunity had popped up for mixing my favorite old-school .NET trick into my favorite new-school paradigm.
-
Persisting Select Menus on Postback with FluentHtml and ASP.NET MVC
Last night I was having some problems with a simple piece of functionality using ASP.NET MVC and FluentHtml (the MvcContrib flavor). When a user selected from a menu, which in this case caused a form to be posted back to the server, upon postback the user’s selection was cleared. The post happened and the corresponding behavior would occur, but the selection had been cleared.
-
Testing ASP.NET MVC with QUnit - Part 2
In Part 1 of this series I demonstrated how QUnit can be used to test JsonResult action methods in ASP.NET MVC applications. Part 2 will take the idea a little further by showing an example of how QUnit can be used to inspect potential user-input areas on your MVC forms and to use those values in tests that will verify the requirements have been met.
-
Testing ASP.NET MVC with QUnit - Part 1
One of the problems that face any web developer is their ability to properly test the GUI components of their sites. A few options exist, specifically Watin, with varying degrees of success. Now that I've been experimenting with the ASP.NET MVC framework I've modified a good deal of my GUI work in such a way that it minimizes form-posts and makes use of the AJAX goodies packed into jQuery. Since a lot of my work has moved to the client following my adoption of this approach I needed to investigate new options for testing. This morning I had the luck to stumble across QUnit, a jQuery testing plugin that makes life pretty easy.
-
ASP.NET MVC Model Binding Example
Scott does an excellent job in his introduction blog post to the new features in the ASP.NET MVC beta release. The Model Binder support is an excellent feature for which I wanted to put forth a simple example.
-
Brian Hitney's Enterprise Guild MVC Presentation
Tonight I attended the local Enterprise Guild's ASP.NET MVC presentation by Brian Hitney. I don't know if I've ever given a review of a colleague's presentation (so this might suck) but I feel one's in order. Brian's doing his best in this area for Microsoft to spread this and other information and I want to take a moment to recognize, suggest some critique of, and applaud his efforts.
-
ASP.NET MVC, JSON, and Prototype
I've tinkered with the method of posting JSON between the browser and the server via a generic handler. When the new MVC Preview came out and had native support for JSON I knew I needed to do some further tinkering. This post will describe in brief how to perform such a thing. I'll demonstrate how to perform a login process using JSON communication between an MVC Controller's action method which returns a JsonResult instance. Sounds tricky, but that's how Prototype helps us. It makes the communication process pretty easy. I'll try to be pretty short and sweet here and will keep the code discussion to a bare minimum.