Simon Ince's Blog

Ramblings of a gadget freak

Posts
  • Simon Ince's Blog

    Conditional Validation in ASP.NET MVC 3

    • 27 Comments
    Update: If you like this, you'll like Mvc.ValidationTookit even more - check out this post ! Some time ago I blogged on Conditional Validation in MVC , and Adding Client-Side Script to an MVC Conditional Validator . A number of people have asked me...
  • Simon Ince's Blog

    Flattening XML Data in SQL Server

    • 31 Comments
    If you’ve got some XML data in a SQL Server column, how can you flatten it out and query it or present it as though it was relational data? It turns out this is quite easy... Setup Let’s create a simple table to hold our data; CREATE TABLE XmlSourceTable...
  • Simon Ince's Blog

    View Models in ASP.NET MVC

    • 40 Comments
    Q : Should I have a view Model in my ASP.NET MVC architecture? A : Yes. Well, that was a short post! J Being more serious, this is an interesting topic that the advisors and p&p team discussed a few times while they were building the Reference...
  • Simon Ince's Blog

    Conditional Validation in MVC

    • 23 Comments
    Update: If you like this, you'll like Mvc.ValidationTookit even more - check out this post ! Recently I put together samples for different types of validation for some customers, and one of those was Conditional Validation – that is “this...
  • Simon Ince's Blog

    Mapping two Tables to one Entity in the Entity Framework

    • 11 Comments
    Whilst at Q-Con a few weeks ago someone asked me about how to map two database tables to one entity in the Entity Framework... something a lot of people want to do at some point or another. At this point I must thank Chris Barker for pinging me some links...
  • Simon Ince's Blog

    Adding messages to a Validation Summary

    • 19 Comments
    For a while now I’ve used this handy bit of code to add a message programmatically to a Validation Summary control, without associating it with a Validator. I’ve no idea where it came from – perhaps my head, perhaps someone cleverer than I... so if it...
  • Simon Ince's Blog

    ASP.NET MVC’s Html Helpers Render the Wrong Value!

    • 21 Comments
    First things first – oh no they don’t J But it can look like a bug if you’re not used to MVC, so I thought it worth calling out. Scenario Imagine we have a pair of controller actions like this; [ HttpGet ] public ActionResult Index() ...
  • Simon Ince's Blog

    Hierarchies with HierarchyID in SQL 2008

    • 9 Comments
    If you’ve been following my blog you should remember a couple of posts about hierarchical data in SQL Server, and how Common Table Expressions can be a great way to extract that data. If you’ve not read them, you can find them here and here . In SQL...
  • Simon Ince's Blog

    Mvc.ValidationTookit Alpha Release: Conditional Validation with MVC 3

    • 16 Comments
    Update : I've not forgotten about this everyone, apologies for the delay. My attempt to get approval to publish failed due to vacations (mine and others) so as soon as I can I'll try again. My blog posts on doing conditional validation in MVC have...
  • Simon Ince's Blog

    ASP.NET MVC 3 Optional Parameter Routing Issue

    • 4 Comments
    Update : Phil Haack has now blogged on this under Routing Regression With Two Consecutive Optional Parameters . When upgrading the Labs and Demo code for a course I run from MVC 2 to MVC 3 I discovered some odd behaviour with one of the routes. We...
  • Simon Ince's Blog

    WCSF Application Architecture 1: Introduction

    • 17 Comments
    [ Edit ] By popular demand (well, one request!) I've added links to all the articles in this series here; WCSF Application Architecture 1: Introduction (this post) WCSF Application Architecture 2: Application Controller WCSF Application Architecture...
  • Simon Ince's Blog

    Monitor your ASP.NET Cache API Behaviour

    • 9 Comments
    Recently I was working on diagnosing a performance issue with a customer’s web site with a colleague (this is one of our favourite engagement types so if you need some help let me know J ), and we found that items were being trimmed very regularly from...
  • Simon Ince's Blog

    jQuery + MVC = Progressive Enhancement

    • 6 Comments
    If you write a lot of JavaScript, you really should consider adopting Progressive Enhancement as the standard way that you work. This is basically whereby you write a web site without script, and then enhance it with script. The result is a site that...
  • Simon Ince's Blog

    WCSF Application Architecture 7: Remote Logic with WCF Services

    • 14 Comments
    This article is part of a series; · WCSF Application Architecture 1: Introduction · WCSF Application Architecture 2: Application Controller · WCSF Application Architecture 3: Model View Presenter · WCSF Application Architecture 4: Environment...
  • Simon Ince's Blog

    Dependency Injection is Dead!

    • 38 Comments
    Long live “Dependency Resolution”! OK, so I’m not really serious – but I got your attention right? Truth is, I personally love Dependency Injection , but that doesn’t mean it isn’t without its flaws. The Service Locator pattern is often touted as Dependency...
  • Simon Ince's Blog

    Auditing Data Changes in the Entity Framework: Part 2

    • 16 Comments
    In my previous post I described the basic concept behind my auditing approach using the Entity Framework, and covered some of the problems I encountered. This post focuses on the solution I went with; do feel free to comment if you have any thoughts....
  • Simon Ince's Blog

    jQuery.validate and Html.ValidationSummary playing nice together

    • 4 Comments
    A customer recently asked me how to get MVC with the MVC Futures project’s MicrosoftMvcJQueryValidation.js adapter file to play nicely with the Validation Summary HTML helper. It turns out that this functionality isn’t built into the adapter...
  • Simon Ince's Blog

    Detecting which button was clicked in MVC

    • 8 Comments
    I’ve seen a few hacks in the past to try and work out which button caused a form POST in ASP.NET MVC, but the truth is it is pretty easy. Step 1 : Inside your form, add two Submit buttons. Add a name attribute to both (note it isn’t added by MVC by default...
  • Simon Ince's Blog

    Hierarchies WITH Common Table Expressions

    • 13 Comments
    Storing hierarchical data in a database is a very common task, and SQL Server 2005 brings us Common Table Expressions (CTEs) – a very useful tool for retrieving such data both elegantly and efficiently. I haven’t actually used these before, and they came...
  • Simon Ince's Blog

    The ASP.NET MVC framework, using the WCSF as a yardstick!

    • 20 Comments
    Well, right up until this morning I was planning on blogging about the similarities and differences between the patterns used by the Web Client Software Factory (WCSF) and the up and coming ASP.NET MVC Framework ... and then I saw Glenn’s post linking...
  • Simon Ince's Blog

    View Model versus Domain Entity Validation with MVC

    • 3 Comments
    I blogged way back in January about what I see as the three variants of View Model usage in ASP.NET MVC. If you’ve not read that post, check it out here and report back! The Problem What I’ve started to see is that many other developers like my approach...
  • Simon Ince's Blog

    WCSF Application Architecture 2: Application Controller

    • 23 Comments
    This article is part of a series; · WCSF Application Architecture 1: Introduction So why do we have patterns? I think it is basically to reuse good designs, and to adopt a common terminology when discussing software. But so often the subtleties...
  • Simon Ince's Blog

    Unit Testing ASP.NET MVC Routes

    • 1 Comments
    Two things I always encourage customers to do are; Always delete the default route pattern after a File –> New project. This helps you focus on designing your routes throughout your site, and helps reduce SEO-unfriendly routes etc. Always unit test...
  • Simon Ince's Blog

    WCSF Application Architecture 3: Model View Presenter

    • 22 Comments
    This article is part of a series; · WCSF Application Architecture 1: Introduction · WCSF Application Architecture 2: Application Controller Model View Presenter The MVP pattern is effectively an evolution of Model View Controller, and is mainly...
  • Simon Ince's Blog

    What on Earth is a Lambda Expression?

    • 26 Comments
    Recently I've spoken with a few customers that have asked what a Lambda Expression is, which surprised me. It seems that a second wave of developers are now starting to use Lambdas (i.e. those that didn't adopt C# 3.0 immediately) and need some pointers...
Page 1 of 5 (124 items) 12345