Chris Sainty

A technical blog covering full-stack web development.

twitter | github | stackoverflow

in , ,

ASP.NET MVC Application Layout

I am slowly evolving my general layout for ASP.NET MVC applications as I come more and more to grips with the framework and they ways I am most comfortable using it.

This post is going to be a bit of an overview of how I am laying out my project at the moment in case it is of use to anyone.

Read More

in , , ,

RenderComponent() or RenderUserControl()

One thing I have always needed to do in my web sites is break sections of pages out into a re-usable component. If you look at http://www.ht.com.au the "Featured Product Of The Month" panel displays three product "patches". This exact same patch is used on the Cart page and the Hub pages. It is a nice little class/template that you pass a product number to and it spits back the HTML for that patch, which you write out like any other expression in your template.

Read More

in , , ,

ASP.NET MVC - Testing

I have been further exploring the concepts of Test Driven Development of late, in particular around the ASP.NET MVC framework.

One concept that is very new to me is mocking. I have been using Rhino Mocks. This is not going to be a post about mocking, I am far much of a novice to offer any useful advice on this front just yet. However, it is pretty cool stuff and worth a read.

Read More

in ,

LINQ to SQL: SQLMetal.exe

I have recently switched over to using SQLMetal to generate my LINQ-to-SQL DBML and Context class. There are two things I like about it, one is that it is far faster. I just click a script on my desktop rather than open up the designer and recreate each table that has changed. I also prefer some of its naming conventions, it deals with multiple relationships to a  single table better.

Consider the case where you have an Orders table and it has two fields holding Address keys (ie ShippingAddressID and InvoiceAddressID). The LINQ-to-SQL generator in Visual Studio will create 4 properties ShippingAddressIDInvoiceAddressID, Address, Address1. The last two being references to the Address entities. The problem being you cant work out which is which. SQLMetal will detect this and one of them will be named ShippingAddress, sadly the other will still be simply Address. There is hope though.

Read More

in ,

YUI - Yahoo! UI Library

I am spending the weekend getting to know a bit more about the Yahoo! User Interface Library.
You can find more details yourself here http://developer.yahoo.com/yui/

They do a good summary on their site, so let me start by simply quoting Yahoo!

Read More