Simon Ince's Blog

Ramblings of a gadget freak

Browse by Tags

Tagged Content List
  • Blog Post: Injecting Custom HTML Attributes in ASP.NET MVC

    Recently Stuart Leeks and I have developed a worrying pattern of having the same ideas at the same time. I’m starting to doubt we’re different people. Except he’s about a foot taller so maybe that’s aspirational from my side. Our latest coinciding of ideas was a way to automatically...
  • Blog Post: Templated Razor Delegates combined with Partial Views

    I was with a customer in Germany this week, and just before I left one of the (rather talented I might say) developers asked me about passing markup into an HtmlHelper extension. It turns out this is pretty easy, as covered by Phil Haack under Templated Razor Delegates . However, I particularly like...
  • Blog Post: Mvc.ValidationTookit Alpha Release: Conditional Validation with MVC 3

    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 always been popular, and I’m frequently surprised...
  • Blog Post: Immersive MVC and jQuery: Project Silk

    Patterns and Practices have just released their latest round of guidance for developing web applications - “Project Silk”. I’ve been watching what they generate closely and I think you’ll be impressed. To quote the landing page; “Project Silk provides guidance for building maintainable cross-browser...
  • Blog Post: Project Silk: Patterns and Practices do Rich Web Apps

    My blog has been quiet of late – because our team is busy I think. We’re recruiting by the way Something I’ve been wanting to blog about for a while now is “Project Silk”. This is Patterns & Practices latest round of web development guidance. Karl Shifflett  is the man at the wheel, so be sure...
  • Blog Post: Detecting which button was clicked in MVC

    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); 1: < p > 2: < input type ="submit"...
  • Blog Post: Conditional Validation in ASP.NET MVC 3

    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 to update the sample to MVC 3, so guess what –...
  • Blog Post: ASP.NET MVC 3 Optional Parameter Routing Issue

    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 have a very simple route to handle an “archive”...
  • Blog Post: Unit Testing ASP.NET MVC Routes

    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 your routing table. For number two, this is because...
  • Blog Post: Optimising ASP.NET Performance

    Something I do a lot with customers is improving their ASP.NET Web Site performance. Most people spend hours looking at server-side performance, but just don’t realise what kind of gains you can get by looking at often-overlooked settings. I’ve seen cases when enabling GZIP compression in IIS and setting...
  • Blog Post: Controller Action Design in MVC

    Validate, Act, Translate, and Respond. That’s about it. I’ve been trying to come up with a nice acronym for how to structure code in Actions for some time now, and this is the best I have managed. I wish it spelt a nice word – so if you’ve a better suggestion shout up. What...
  • Blog Post: Adding Client-Side Script to an MVC Conditional Validator

    Update: If you like this, you'll like Mvc.ValidationTookit even more - check out this post ! In a previous post I covered how to write a conditional validator to work with ASP.NET MVC, and a little gotcha to avoid. However, I didn’t include any details on how to wire up this validator with some...
  • Blog Post: Conditional Validation in MVC

    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 field is required if another field is true”...
  • Blog Post: jQuery.validate and Html.ValidationSummary playing nice together

    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 script file. They also pointed me at this post...
  • Blog Post: ASP.NET MVC’s Html Helpers Render the Wrong Value!

    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() { var model = new MyModel { Count = 1 ...
  • Blog Post: jQuery + MVC = Progressive Enhancement

    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 does not rely on JavaScript (and hence works with...
  • Blog Post: Packaging UI Components in MVC

    Something I get asked by most customers starting out with ASP.NET MVC is how they should package, group, factor, and reuse their UI components. We're all used to thinking about User Controls, Custom Controls, and other Web Forms approaches. But rest assured, MVC provides a wealth of options. The thoughts...
  • Blog Post: Generic or Specific Routes?

    A topic of discussion I've heard a few times when using Routing in ASP.NET concerns whether you should use the default generic route pattern for most of your controllers, or whether you should specify individual routes for every action. (this applies primarily to ASP.NET MVC today, but as routing...
  • Blog Post: View Models in ASP.NET MVC

    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 Implementation for the soon-to-be-complete Web...
  • Blog Post: Check out the Web Client Guidance

    If you've not come across the Web Client Guidance that patterns & practices have been working on, now is the time to head on over to their CodePlex site; http://webclientguidance.codeplex.com/ The team have been really busy pulling together resources, advice, and guidance on a lot of topics...
  • Blog Post: Loading Scripts Late

    On the ASP.NET ScriptManager control there is a useful little property that very few people have heard of called “LoadScriptsBeforeUI”. What does it do? Well, simply put... · When “true” (the default) it will render <script> tags for each script you reference using the ScriptManager at the...
  • Blog Post: Executing JavaScript after a Partial Render

    I had a fun day debugging some ASP.NET plus jQuery this week, and came across something I’ve known is possible for some time, but that I’ve never actually needed to do... and that was to ensure a bit of JavaScript ran once an UpdatePanel had refreshed as part of a partial render. It turns out that...
  • Blog Post: Do you need web client development help?

    Then tell us what you need! Blaine has blogged a link to a survey that patterns & practices will use to help them understand what challenges that are affecting you the most... so that they can choose the right areas to focus effort in providing guidance. If you’ve got a couple of minutes spare...
  • Blog Post: Monitor your ASP.NET Cache API Behaviour

    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 the ASP.NET Cache, causing excessive back-end work...
  • Blog Post: Detecting Server.Transfer

    How do you know when a page is being rendered as the result of a Server.Transfer, rather than a Response.Redirect or the user browsing directly to a page? Actually it’s quite easy, assuming you’re using the default ASP.NET pipeline. In reality the “thing” that is responsible for handling an HTTP request...
Page 1 of 2 (37 items) 12