Microsoft MVC bloggers

Sponsors

April 2009 - Posts

ASP.NET MVC NerdDinner Walkthrough
At long last, the book that I worked on with Scott Hanselman , Rob Conery , and Scott Guthrie is in stock at Amazon.com . To commemorate the book being available, the two Scotts worked very hard to convert the free eBook of chapter 1 (the end-to-end walkthrough) from the PDF into a series of HTML articles . This is a great series which walks through the construction of the NerdDinner website . It touches upon most of the day-to-day aspects of ASP.NET MVC that you’ll want to know. It’s a great way to start understanding how the pieces largely fit together. The rest of the book is for those who want to drill deep into the details of how the framework works. We tried to pepper the book with notes and anecdotes from the product team in a style similar...
Free ASP.NET MVC “NerdDinner” Tutorial Now in HTML
Last month I blogged about a free end-to-end ASP.NET MVC tutorial called “NerdDinner” that I wrote for the Professional ASP.NET MVC 1.0 book from Wrox Press.  The book is now released and shipping on Amazon .  The NerdDinner tutorial walks through how to build a small, but complete, application using ASP.NET MVC, and introduces some of the core concepts behind it.  You can download a PDF version of the tutorial here . NerdDinner Tutorial Now Also Available in HTML A few minutes ago I finished publishing an HTML version of the NerdDinner tutorial as well.  You can read it online for free here . I split the tutorial up across 12 segments to make it more manageable to read.  I also increased the sizes of the screenshots...
ELMAH: Error Logging Modules and Handlers for ASP.NET (and MVC too!)
Joe Lowrance said, er tweeted, it best when he said , "the amount of attention ELMAH hasn't got is shocking." ELMAH is one of those largely unknown and deeply awesome .NET Open Source projects that should be part of ASP.NET proper. What is ELMAH? I like to say that ELMAH is Tivo for your ASP.NET Errors . You can get your Yellow Screens of Death, with full call-stack back and analyze what's really happening. It's Exception Driven Development . What's it really do? Once ELMAH has been dropped into a running web application and configured appropriately, you get the following facilites without changing a single line of your code: Logging of nearly all unhandled exceptions. A web page to remotely view the entire log of recoded...
Scripting ASP.NET MVC Views Stored In The Database
Say you’re building a web application and you want, against your better judgment perhaps, to allow end users to easily customize the look and feel – a common scenario within a blog engine or any hosted application. With ASP.NET, view code tends to be some complex declarative markup stuck in a file on disk which gets compiled by ASP.NET into an assembly. Most system administrators would first pluck out their own toenail rather than allow an end user permission to modify such files. It’s possible to store such files in the database and use a VirtualPathProvider to load them, but that requires your application (and thus their views) to run in full trust. Is there a way you could safely store such views in the database in an application running...
Next Stop, Norway!
Because of all the travel I did last year as well as the impending new addition to the family this year, I drastically cut down on my travel this year. There are only two conferences outside of Redmond I planned to speak at, one was Mix ( see the links to videos of my talks ) and the next one is the Norwegian Developer Conference also known as the NDC. Hanselman spoke at this conference last year and tells me it’s a good one. Besides, it’s in Norway! I’ve travelled through Norway once during college, taking a train from Oslo to Bergen, riding a boat on the fjords, and enjoying the profound natural beauty of the country. I guess I have a thing for cold places. :) I’m pretty excited about the speaker line-up which includes a lot of great .NET...
Using jQuery Grid With ASP.NET MVC
Continuing in my pseudo-series of posts based on my ASP.NET MVC Ninjas on Fire Black Belt Tips Presentation at Mix (go watch it!), this post covers a demo I did not show because I ran out of time. It was a demo I held in my back pocket just in case I went too fast and needed one more demo. A common scenario when building web user interfaces is providing a pageable and sortable grid of data. Even better if it uses AJAX to make it more responsive and snazzy. Since ASP.NET MVC includes jQuery, I figured it’d be fun to use a jQuery plugin for this demo, so I chose jQuery Grid . After creating a standard ASP.NET MVC project, the first step was to download the plugin and to unzip the contents to my scripts directory per the Installation instructions...
ASP.NET MVC Tip #50 – Create View Models
Recently, I noticed a nice pattern in the Nerd Dinner application. Nerd Dinner uses strongly typed view model classes to pass data from a controller to a view. This pattern provides you with a convenient way of representing complex view data. Note: If you haven’t downloaded the Nerd Dinner sample ASP.NET MVC application yet, you really should. It is a really easy to understand sample application that you can use as a great introduction to ASP.NET MVC. You can download it from the http://www.ASP.net/mvc page. In an ASP.NET MVC application, you pass data from a controller to a view by using view data. There are two ways that you can use view data. First, you can use view data as an untyped dictionary. For example, the controller in Listing 1 returns...
TDD Tests are not Unit Tests
The motivation for this blog entry is to explain the nature and purpose of the tests used in Test-Driven Development. To avoid confusion, I’ll use the expression TDD test to refer to the type of test used in the context of Test-Driven Development. The goal of this blog entry is to clarify the relationship among TDD tests, unit tests, and acceptance tests. TDD Tests are not Unit Tests Let’s start with the distinction between TDD tests and unit tests. On the surface, TDD tests are very similar to unit tests. This is not surprising, since you use a unit testing framework such as Visual Studio Tests or NUnit to create both types of tests. The purpose of a unit test is to test a unit of code in isolation. For example, you might create a unit test...
Test-After Development is not Test-Driven Development
Recently, I had a disagreement with a colleague over the correct way to do Test-Driven Development. This is an important disagreement because it affects the design of the ASP.NET MVC framework. According to my co-worker (let’s call him Tad), there is no difference between Test-First Development and Test-After Development “except when you write your unit tests.” Tad is a practitioner and proponent of Test-After Development. When you practice Test-After Development, you write application code first and then you write a unit test that tests the application code. From the perspective of someone who practices Test-Driven Development , this gets things backwards. I believe that it is an essential part of Test-Driven Development that you must write...
TipJar: Title Tags and Master Pages
There are a couple of peculiarities worth understanding when dealing with title tags and master pages within Web Forms and ASP.NET MVC . These assume you are using the HtmlHead control, aka <head runat="server" />. The first peculiarity involves a common approach where one puts a ContentPlaceHolder inside of a title tag like we do with the default template in ASP.NET MVC: <%@ Master ... %> < html > < head runat ="server" > < title > < asp:ContentPlaceHolder ID ="titleContent" runat ="server" /> </ title > </ head > ... What’s nice about this approach is you can set the title tag from within any content page. < asp:Content ContentPlaceHolderID ="titleContent"...
More Posts Next page »