Contents tagged with asp.net mvc

  • Custom Authentication with MVC 3.0

    Tags: asp.net mvc, security

    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

    Tags: 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

    Tags: tdd, jQuery, asp.net mvc

    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

    Tags: tdd, jQuery, asp.net mvc

    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, JSON, and Prototype

    Tags: asp.net mvc

    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.

Windows Azure Training

Looking for information on Windows Azure? I work with a great team of guys who put together the Windows Azure Training Kit. If you're doing anything with Windows Azure and you have questions, chances are pretty good you'll find what you're after here. 

My SignalR Samples

After having given a few SignalR presentations I decided to start compiling all the code in a centralized repository. Check out my SignalR Samples repository on GitHub.com

Channel 9

One of the coolest parts of my job is being able to host a Channel 9 TV show. Web Camps TV is the show I co-host with Cory Fowler. Check out our episodes on Channel 9, where we talk to Microsoft community members and engineers.