Microsoft MVC bloggers

Sponsors

August 2009 - Posts

Fun With Method Missing and C# 4
Warning : What I’m about to show you is quite possibly an abuse of the C# language. Then again, maybe it’s not. ;) You’ve been warned. Ruby has a neat feature that allows you to hook into method calls for which the method is not defined. In such cases, Ruby will call a method on your class named method_missing . I showed an example of this using IronRuby a while back when I wrote about monkey patching CLR objects . Typically, this sort of wild chicanery is safely contained within the world of those wild and crazy dynamic language aficionados, far away from the peaceful waters of those who prefer statically typed languages. Until now suckas! ( cue heart pounding rock music with a fast beat ) C# 4 introduces the new dynamic keyword which adds...
Rest For ASP.NET MVC SDK and Sample
When building a web application, it’s a common desire to want to expose a simple Web API along with the HTML user interface to enable various mash-up scenarios or to simply make accessing structured data easy from the same application. A common question that comes up is when to use ASP.NET MVC to build out REST-ful services and when to use WCF? I’ve answered the question before, but not as well as Ayende does (when discussing a different topic). This is what I tried to express. In many cases, the application itself is the only reason for development [of the service] “ [of the service] ” added by me. In other words, when the only reason for the service’s existence is to service the one application you’re currently building, it may make more sense...
Hanselminutes Podcast 175 - Optimizing Your Website with Jeff Atwood and Stackoverflow
My one-hundred-and-seventy-fifth podcast is up . It's the return of Jeff Atwood. He and the team have been making lots of great speed optimizations to Stackoverflow lately. What tools are they using? What kinds of speed improvements are they seeing, and what can you do to exploit their experience? Subscribe: Download: MP3 Full Show Do also remember the complete archives are always up and they have PDF Transcripts , a little known feature that show up a few weeks after each show. Telerik is our sponsor for this show. Check out their UI Suite of controls for ASP.NET . It's very hardcore stuff. One of the things I appreciate about Telerik is their commitment to completeness. For example, they have a page about their Right-to-Left support...
Default Templated Views
Note, this blog post is based on Preview 1 of ASP.NET MVC 2 and details are subject to change. I’ll try to get back to normal ASP.NET MVC 1.0 content soon. :) While in a meeting yesterday with “ The Gu ”, the topic of automatic views came up. Imagine if you could simply instantiate a model object within a controller action, return it to the “view”, and have ASP.NET MVC provide simple scaffolded edit and details views for the model automatically. That’s when the light bulb went on for Scott and he briefly mentioned an idea for an approach that would work. I was excited by this idea and decided to prototype it tonight. Before I discuss that approach, let me lead in with a bit of background. One of the cool features of ASP.NET MVC is that any views...
Put Your Views (and Pages) On a Diet
One of the complaints I often here with our our default view engine and Pages is that there’s all this extra cruft in there with the whole page directive and stuff. But it turns out that you can get rid of a lot of it. Credit goes to David Ebbo , the oracle of all hidden gems within the inner workings of ASP.NET, for pointing me in the right direction on this. First, let me show you what the before and after of our default Index view ( reformatted to fit the format for this blog ). Before <%@ Page Language ="C#" MasterPageFile ="~/Views/Shared/Site.Master" Inherits ="System.Web.Mvc.ViewPage" %> < asp:Content ID ="indexTitle" ContentPlaceHolderID ="TitleContent" runat ="server"...
ASP.NET MVC Framework Unleashed in Bookstores!
ASP.NET MVC Framework Unleashed is now published and available at your local bookstore and Amazon. I devoted over a year of my life to writing this book. At over 700 pages, this book is one of the most comprehensive books on Microsoft’s newest framework for building web applications. Buy the book at Amazon All of the code samples are included in both the C# and VB.NET programming languages in the text of the book. You can download the source code from the book by visiting my publisher’s website at: http://www.informit.com/store/product.aspx?isbn=0672329980 You can download a single file that includes all of the code or you can download the code chapter by chapter. Just click the Downloads tab at the website. I had a lot of help writing this...
More Posts