Pgh.NET: Dissecting – A Look at a Real World .NET MVC Implementation

Tuesday, December 8 | 5:30 – 7:30 p.m.
This event is free, please RSVP.

Join us for our next PGHDOTNET meeting on December 8, 2009, at 5:30 p.m. at the Microsoft Offices on the North Shore. Steve Andrews will present on Dissecting A Look at a Real World .NET MVC Implementation.

The ASP.NET MVC Framework provides a powerful Model View Controller (MVC) approach to building web applications, and provides separation of concerns, increased testability, control over HTML output, and intuitive URLs. We will start by looking at building a model framework with LINQ to SQL, including validation and model binding. Then, we'll explore a custom generics-based repository and services implementation. Finally, we'll tie it all together with a look at Views and jQuery.

Sponsored by:

Microsoft Donates the ASP.NET Ajax Library Project to the CodePlex Foundation

November 18, 2009. CodePlex Foundation Announces Creation of First Gallery, Acceptance of First Project
ASP.NET Open Source Gallery, ASP.NET Ajax Library Project first proofs of Foundation model

The CodePlex Foundation today announced the creation of the first Foundation project gallery, the ASP.NET Open Source Gallery, and the acceptance of the first project into that gallery, the ASP.NET Ajax Library project. The gallery and project were evaluated for acceptance using the Foundation's Project Acceptance and Operation Guidelines, first published October 21, 2009. The gallery and project are supported by Microsoft, the Foundation's founding sponsor.

"Bringing the first project gallery and project into the CodePlex Foundation shows significant progress against our 100 day goals," said Sam Ramji, Interim President, CodePlex Foundation. "The ASP.NET Ajax Library project is important for its great value to both the open source and commercial software worlds, and the Foundation is the best forum in which to shepherd its future development."

Gallery and Projects

The ASP.NET Ajax Library consolidates ASP.NET Ajax and the Ajax Control Toolkit into a single open source project. The Ajax Control Toolkit and Ajax Libraries, components of many web development strategies, make it easy for developers to use the Ajax programming model in their websites and web applications.

The ASP.NET Ajax Library project will be released under a BSD license and can be used with many technologies, including, but not limited to ASP.NET, PHP and Ruby on Rails. Future development of the project will be done within the ASP.NET Open Source Gallery under the aegis of the CodePlex Foundation.

The CodePlex Foundation Gallery Model

The CodePlex Foundation in October announced an innovative gallery sponsorship model that uses museums as a design pattern. The organizational structure divides the Foundation into galleries – collections of thematically related projects – which benefit from a common set of services provided by the Foundation.

Galleries may be sponsored by a third-party organization, e.g. a commercial software company, or run by the Foundation. Galleries will rely on Foundation staff and volunteers to provide a set of support services, including administration, security, best practices and marketing.

About the CodePlex Foundation

The CodePlex Foundation is a not-for-profit foundation created as a forum in which open source communities and the software development community can come together with the shared goal of increasing participation in open source community projects. For more information about the CodePlex Foundation contact

Free MVC “Cheat Sheet”

Hot off the presses from Refcardz:

Getting Started with ASP.NET MVC 1.0 

Anyone interested in learning the basics of ASP.NET MVC, Microsoft's new framework for building Web applications, should definitely check out this DZone Refcard. You'll learn how to setup your environment and how to create a web application. Then, you'll get to go deeper into detail and learn about components of the framework along with the structure of the main API.

Full story and free download at

ASP.NET MVC Firestarter in Pittsburgh

Coming soon to Pittsburgh:

When it comes to design patterns, the MVC is the granddaddy of them all.  First described in the late 70s, the MVC pattern remains very popular in the world of web applications today. ASP.NET MVC provides a framework that enables you to easily implement the model-view-controller (MVC) pattern for Web applications. This pattern lets you separate applications into loosely coupled, pluggable components for application design, processing logic, and display.

Throughout the day we will be demonstrating the ASP.NET MVC Framework in a cookbook-style approach with recipes on how to solve common challenges when developing MVC web applications. No previous knowledge or experience is necessary. We will walk you through the basics on creating views and controllers and by the end of the day show you how to develop end-to-end MVC applications complete with ajax, authentication, authorization, caching, databinding, logging, persistence, validation, and other common challenges we experience in day-to-day development.

Sample code will leverage and integrate popular frameworks and libraries like ADO.NET Data Services, ASP.NET AJAX, ASP.NET Dynamic Data, Enterprise Library, Entity Framework, and LINQ To SQL to show you how to write less code and be more productive during your development.

Polish it all off with examples showing the extensibility of the MVC Framework using custom controller factories, alternative view engines, and custom action filter attributes just to name a few.

Topics covered will include “How Do I…”

– Create Views Easily? ( HTML and Url Helpers )
– Handle Get and Post Requests? ( simple databinding of action method arguments, ActionResults, etc.. )
– Pass Data Between Views and Controllers? ( ViewData and TempData )
– Bind Views and Forms to complex data types? ( ModelBinders )
– Handle Errors Gracefully? ( ActionFilter Attributes )
– Provide Input Error Validation? ( ValidationMessage, ValidationSummary, ViewData.ModelState )
– Handle Authentication and Authorization? ( ActionFilter Attributes and Membership Provider )
– Persist to a database ( LINQ To SQL, Entity Framework )
– Log Messages to Database, File, EventLog ( ActionFilter Attributes, etc. )
– Leverage AJAX and JSON? ( ASP.NET AJAX and jQuery )

Some of the more complex and non-beginner topics can be discussed if time is allowed and/or maybe discussed afterwards in a social environs…

– Alternate View Engines
– IoC and Custom Controller Factories
– Unit Testing

Bring your USB Flash Drive to grab the sample code and begin developing ASP.NET MVC Web Applications today!

Register online at

DotNetSlackers Article: Easy XML to SQL with Linq

My latest DotNetSlackers article was published today: Easy XML to SQl with Linq.

Transferring data between partner companies is pretty routine, and XML is one of the common formats that data are transferred in. One of the more common destinations for the XML data is a SQL Server database. In the past, XML was difficult to work with, but the .NET framework improved XML parsing greatly. Linq to XML has made XML handling absolutely painless, and Linq to SQL makes entering the data just as easy.

This example isn’t meant to say this is the only way to transform XML into SQL, because like all things .NET, there are several ways to do this. This method may or may not work depending on your circumstances.

This article is based on my real world experiences using Linq-to-SQL, Linq-to-XML and the XML extensions in VB.NET to rapidly develop transformations of XML data into SQL Server databases.  This is an extremely common scenario in many businesses, and I wanted to highlight how easy it is.

VS2008 SP1 and .NET 3.5 SP1 Released

Old news by now, but SP1 is out with all sorts of glorious new features, except a good installation path.  If you have several machines to update with both VS2008 SP1 and .NET 3.5 SP1 (e.g., a team), you’ll want the ISO file, which can be tricky to find.  Direct link to combined installer .iso.  And, I use the awesome freeware ImgBurn to create the disks for my team.

I’ve seen a couple reports that the installation takes 3+ hours, but all told installation for me went 45 minutes.  I cheated, and downloaded the .NET 3.5 SP1 first (full package at, installed that, then ran the combo installer. 

Greg has a great list of VS2008 things to download (including the MSDN update and training pack) at

As always, make sure to remove any previous betas of the SP (both .NET and VS) you have installed.  I had the SP beta installed, and got rid of it from Add/Remove programs before I installed anything.  If you have any hotfixes installed, you need to remove those as well.  This time, there’s a hotfix removal tool.

Unlike Craig Shoemaker, I was not asked for the original media.  I installed the MSDN updates, too, which tool a little over 30 minutes themselves.  All told, you’re investing a couple hours for a full update. Launches

Shiny new thing to eat up bandwidth!

I’m a solo developer in a corporate environment, so I’m really on my own to learn new things.  As good as blogs and books are, there’s sometimes no substitute for being shown how.  That’s why Microsoft highlights so many videos on its site.  ASP Alliance also has a growing library of videos.

Enter onto this list one more site–  Right now there are around 100 videos on a great number of topics.  Apparently there are a couple hundred more in the pipeline.  And, if you sign up now, you get 6 months of ASP.NET Pro magazine for free.  That alone is worth the sign-up.  ASP.NET Pro is one of my favorite trade mags (I have an online subscription, and have for several years).

When you’re Googling for info on whatever you’re working on, don’t forget to check out this site, too, and see if someone is showing you how it’s done.

Full disclosure: I was asked to say something about the new site, and I usually ignore such requests.  But after checking it it, it’s one I’ll be spending some time on, and recommending to others.

(edit – fixed links)

Easy SQL to XML with LINQ and Visual Basic 2008

My latest ASP Alliance article has been published:

Easy SQL to XML with LINQ and Visual Basic 2008

In this article, I demonstrate how to create an XML file from a SQL Server 2005 database using LINQ. He provides a detailed explanation of the relevant steps with the help of source code and screenshots captured from Visual Basic 2008 Express Edition. At the end of the article, he also gives a few references where you can learn more regarding the techniques involved with LINQ.

If you’re looking for a super quick intro to using Linq to SQL and Linq to XML using Visual Basic, this might be what you’re looking for.  I’ve added links to a couple other useful references, too.

This is beautiful code

If you’ve ever listened to Hanselminutes, you’ve no doubt heard Scott
mention “code smell” or “pretty code”.  The new language features in VB9,
including LINQ and XML being a native type, make XML generation not only easy,
but beautiful.  Aside from the color scheme, look at how smooth this code
snippet is.

Dim _order As New XElement(<Order>
    <ShipperRef><%= h.UniqueRef %></ShipperRef>
    <UniqueRef><%= IIf(h.CustomerPo <> "", h.CustomerPo, h.JdeNumber) %></UniqueRef>
    <Comments><%= _orderComments %></Comments>
    <OrderType><%= h.OrderType %></OrderType>
    <Workflow><%= h.Workflow %></Workflow>
    <RORRelationship><%= h.RORRelationship %></RORRelationship>
    <Supplier><%= h.SupplierNumber.ToString %></Supplier>
    <Customer><%= h.Customer.ToString %></Customer>
    <FreightBillableParty><%= h.FreightBillableParty %></FreightBillableParty>
    <HAZMAT><%= h.Hazmat %></HAZMAT>
    <GroupAssignment><%= SetGroupAssignment(h.GroupAssignment) %></GroupAssignment>
    <Weight><%= _orderWeight.ToString %></Weight>
    <Volume><%= _orderCube.ToString %></Volume>
    <OrderContact><%= h.PrimaryContactAssignment %></OrderContact>
    <ShipmentContact><%= h.PrimaryContactAssignment %></ShipmentContact>

2008 theme is DesertNights
, and the code was copied with CopySourceAsHtml.