Articles : Page 1 of 2
-
Two bugs in ASP.NET MVC 3 and a workaround for both
Jun 1114So I spent an hour today arsing about with a couple of ASP.NET MVC 3 bugs. One was a Routing issue that caused it to act differently to MVC 2. The second I found was a FormsAuthentication issue that insisting on sending me to /Account/Login. Amazing how this crept in really given that it was community tested to death with such a massive ASP.NET MVC following so it is a wonder they weren't weeded out and fixed before RTM. Oh well, don't pretend you don't like a challenge. Routing doesn't work t...
-
Routing Regression With Two Consecutive Optional Url Parameters
Feb 1120It pains me to say it, but ASP.NET MVC 3 introduces an ugly regression in routing from ASP.NET MVC 2. The good news is that there’s an easy workaround. The bug manifests when you have a route with two consecutive optional URL parameters and you attempt to use the route to generate an URL. The incoming request matching behavior is unchanged and continues to work fine. For example, suppose you have the following route defined: routes.MapRoute("by-day", "archive/{month}/{day}", new { contro...
-
MvcSiteMapProvider 3.0.0 released
Feb 1104Just a quick note to tell that MvcSiteMapProvider 3.0.0 has been released and is available on CodePlex and NuGet. This version is targeted at ASP.NET MVC 3. If you are still using ASP.NET MVC 2, no worries: version 2.3.1 contains the exact same functionality but is targeted at ASP.NET MVC 2. The changelog: Additional UpdatePriority options for generating XML sitemaps Allow to specify target on SiteMapTitleAttribute One action with multiple routes and breadcrumbs Medium Trust optimizatio...
-
ASP.NET MVC 3 Extensionless URLs on IIS 6
Dec 1022A lot has been written about how to get ASP.NET MVC running on IIS 6 with extensionless URLs. Up until now, the story hasn’t been very pretty. When running ASP.NET MVC on ASP.NET 4, it gets a lot easier. To be fair, the part that makes it easier has nothing to do with ASP.NET MVC 3 and everything to do with a little known new feature of ASP.NET 4 creatively called the ASP.NET 4 Extensionless URL feature. ASP.NET MVC 3 requires ASP.NET 4 so it naturally benefits from this new feature. If yo...
-
Using RavenDB with ASP.NET MVC
Nov 1008Traditionally when you think about a database you think of tables, views, indexes and stored procedures. If you have made a career out of developing database centric applications like I have, then chances are that you have spent a great deal of time dealing with issues around referential integrity, normalization and performance. Unless you have been living underneath a rock, then you have probably heard of the newest database trend named NoSQL. NoSQL refers to non relational document databas...
-
T4MVC generate lower case paths
Aug 1019I noticed that my URL paths that are being generated using using T4MVC's excellent MVC templating were coming out in title case. This is a problem since we try to keep all URLs lower case since Google deems URL in different cases showing the same result as duplicate content. I looked through a lot of the code that is generated by the tool and traced the problem all the way to the MyController.generated.cs file: public class ActionNamesClass { public readonly string Index = "Index"; public re...
-
ASP.NET MVC 3 Preview 1 Released – Channel 9 Video and Hanselminutes Podcast 224, Oh My!
Jul 1027Phil and friends released ASP.NET MVC 3 Preview 1 today. I snuck into the office of Phil Haack and Morgan the Canadian Intern to talk about the release of ASP.NET MVC 3 Preview 1 and some of the cool futures stuff that Morgan (and our fleet of interns) is working on. This video isn't only about MVC as Morgan's working on some cool CSS Sprites stuff that works nicely in WebForms that you should check out as well. Also, my two-hundred-and-twenty-fourth podcast is up and I talk more in depth ...
-
Don't use runAllManagedModulesForAllRequests="true" when getting your MVC routing to work
Jun 1004It seems to be common advice to make your modules section of your web.config say <modules runAllManagedModulesForAllRequests="true">. In fact this is quite a drastic thing to do to solve the routing problem and has global effects that could CAUSE ERRORS. You need a module that goes by the name of UrlRoutingModule-4.0 to be running through IIS. Now, since your MVC URLs are likely to end without .aspx these will not be picked up by IIS and run through the intergrated pipeline and therefore you wi...
-
How to add an ASP.NET MVC 2 project to an existing ASP.NET Web forms application
May 1026In this 'how to' I will demonstrate how to integrate an ASP.NET MVC 2 project to an ASP.NET WebForms application that already exists. There are many weird ungoogleable issues and extra tips that haven't been covered elsewhere. I hope this guide helps you get started. 1. Add referencesRight click on your web root project in Visual Studio (2010 in my case) and add the following references: System.Web.Routing System.Web.Abstractions System.Web.Mvc 2. ConfigurationMake your web.config look like...
-
Globalizing ASP.NET MVC Client Validation
May 1010One of my favorite features of ASP.NET MVC 2 is the support for client validation. I’ve covered a bit about validation in the following two posts: ASP.NET MVC 2 Custom Validation covers writing a custom client validator. Localizing ASP.NET MVC Validation covers localizing error messages. However, one topic I haven’t covered is how validation works with globalization. A common example of this is when validating a number, the client validation should understand that users in the US enter...
- 1
- 2

