Posts
206
Comments
1132
Trackbacks
51
.NET 3.5
Encapsulate Multiple HTML Helpers to Make Views More DRY
MVC 2 is adding many new features that make views more elegant to write. For example, the new EditorFor() Html helper returns the appropriate HTML input elements for a given property so you don’t have to explicitly specify text box, dropdown, or whatever control you need and can even use the [UIHint] attribute to specify the editor you want to use (either an OOTB or custom editor). This results in view markup that often looks like this: 1: <p> 2: <%=Html.LabelFor(m => m.FirstName)%> ......
Posted On Sunday, January 17, 2010 12:52 PM | Comments (4)
LINQ to XML with Hierarchical XML, Optional Elements, and Namespaces
Recently I had an interesting task to consume a particular XML document and populate a C# object from it. The structure of the XML document looked roughly like this: 1: <root xmlns="http://www.w3.org/20... 2: <entry> 3: <id>1</id> 4: <title>abc</title> 5: <content> 6: <div xmlns="http://www.w3.org/19... 7: <table> 8: <tr> 9: <td>Item1</td> 10: <td>111</td> 11: </tr> 12: <tr> 13: <td>Item2</td> ......
Posted On Tuesday, December 29, 2009 11:34 PM | Comments (2)
ASP.NET MVC Application – AlbumCredits.com
Recently my company just released the first version of a new MVC web site: AlbumCredits.com. This project, led by Oskar Austegard, is was I consider a highly successful real-world implementation of MVC. In a time when most music these days is downloaded, the production and performance engineers, and recording professionals that work on the music don’t always get credit because there is no CD booklet to look through. Album Credits is almost like a LinkedIn for recording professionals. From the about ......
Posted On Wednesday, November 18, 2009 10:15 AM | Comments (9)
Microsoft Tech Days – MVC Presentation

On April 1 I will be presenting ASP.NET MVC at Microsoft Tech Days.  This is a totally free 24-hour virtual event.  You can register right now at: http://www.msfttechdays.com. Hope to see you there!

Posted On Saturday, March 14, 2009 12:34 AM | Comments (0)
Presentation at SOMD NUG – LINQ to SQL

Tomorrow I’ll be giving a presentation at Southern Maryland .NET User Group on LINQ to SQL.  Details of the event can be found here:  http://www.communitymegaphone.com/ShowEvent.aspx?EventID=1022.

Posted On Sunday, March 8, 2009 8:46 PM | Comments (2)
Validation Application Block – Unit Test Validation Logic
The Enterprise Library Validation Application Block (VAB) is a great library for putting your validation in your business layer where it belongs rather than in the UI. It allows us to apply attributes to the properties of our business objects like this: 1: public class Person 2: { 3: [StringLengthValidator(1, 20, MessageTemplate="First Name must be between 1-20 characters.")] 4: public string FirstName { get; set; } 5: 6: [StringLengthValidator(1, 20, MessageTemplate="Last Name must be between 1-20 ......
Posted On Tuesday, January 27, 2009 10:27 PM | Comments (3)
Code Sample for Visual Studio Magazine MVC Article

It turns out the code sample that was posted online for my MVC Visual Studio Magazine article was an older version (based on a previous CTP). The latest version based on the MVC beta can be found here.  Let me know if any problems.

Posted On Tuesday, January 27, 2009 9:16 PM | Comments (0)
CMAP Code Camp Fall 2008 - Code Samples
The code samples from my recent presentation at the Maryland CMAP code camp can be downloaded here:

N-Tiered LINQ to SQL

MVC and Unit Testing
Posted On Monday, October 27, 2008 11:20 AM | Comments (1)
CMAP Presentation - ASP.NET MVC and Unit Testing Code Samples

The code samples from my recent presentation at the CMAP Main meeting can be downloaded here: MVC and Unit Testing. The direct download link is here.

Posted On Wednesday, October 8, 2008 7:15 PM | Comments (5)
TryParse Extension Methods
When .NET 2.0 was released, a TryParse() method was added to many value types such as Int32, DataTime, etc. This was a huge improvement because there was no longer a need to catch expensive exceptions and drag down performance. However, one drawback of the TryParse() method is that the syntax is a little clunky. The most common example looks like this: 1: Person person = new Person(); 2: string value = "21"; 3: int num; 4: int.TryParse(value, out num); 5: person.Age = num; So it's great that we can ......
Posted On Sunday, October 5, 2008 5:30 PM | Comments (12)
Full .NET 3.5 Archive

View Steve Michelotti's profile on LinkedIn

profile for Steve Michelotti at Stack Overflow, Q&A for professional and enthusiast programmers




Google My Blog

Tag Cloud