Using a Parameter Attribute to set a Default Value in MVC

A couple days ago I came across a breaking change in ASP.NET MVC PR4 that wasn’t reported. The breaking change is that defaults from routes are no longer used as defaults for parameters in the action method, if no appropriate parameter is found in the request. Basically what this means is the following: I have the following route: URL: /home Controller: Home Action: Index Defaults = page: 1 I set the page so that it always defaults to “1” if no value is found in the query string for “page”. So when a request is executed, the Route passes back the RouteData.Values = controller: “Home”, action: “Index”, page: 1. Then it goes through it’s normally processing and the value of the page’s query string is passed in to my action method for the page parameter. So if query string page = 1 then 1, query string page = 2 then 2, and so on. This is how it worked in PR3 and how I understood it was suppose to work as a concept. However, in PR4, this doesn’t work anymore because of Line 166 in ControllerActionInvoker. It specifically checks that the value is in the route values. However they are always going to be in the route values if they have been defined as a default. ...

August 13, 2008 · 4 min · 836 words · Nick Berardi

Visual Studio 2008 SP1 Released

Visual Studio 2008 SP1 Improved WPF designers SQL Server 2008 support ADO.NET Entity Designer Visual Basic and Visual C++ components and tools (including an MFC-based Office 2007 style ‘Ribbon’) Visual Studio Team System Team Foundation Server (TFS) addresses customer feedback on version control usability and performance, email integration with work item tracking and full support for hosting on SQL Server 2008 Richer JavaScript support, enhanced AJAX and data tools, and Web site deployment improvements The .NET Framework 3.5 SP1 Performance increases between 20-45% for WPF-based applications – without having to change any code WCF improvements that give developers more control over the way they access data and services Streamlined installation experience for client applications Improvements in the area of data platform, such as the ADO.NET Entity Framework, ADO.NET Data Services and support for SQL Server 2008’s new features Team Foundation Server 2008 SP1 A number of improvements have been made to Visual Studio Team System 2008 Team Foundation including: ...

August 12, 2008 · 3 min · 534 words · Nick Berardi

MySQL Officially Declared Microsoft SQL Server Compeditor

I have been a huge fan of MySQL for a long time. It is the perfect database for when the budget is tight or you are not working in a Microsoft Environment. It performs well, and has a huge following of dedicated professional programmers that use it day in and day out on some of the largest websites on the planet. Most noteable Facebook, Twitter, Flickr, and Digg. Even with all these proven capabilities to scale and perform, Microsoft has choosen to ignore it and focus on some of the monolytic providers of databases such as IBM and Oracle when comparing SQL Server. ...

August 10, 2008 · 2 min · 222 words · Nick Berardi

I am ditching Vista for Windows Mojave

I just can’t take Windows Vista anymore so I am ditching it for Windows Mojave. I have heard great things about it and anything must be better than Windows Vista. Check it out for yourself: http://www.mojaveexperiment.com By the way, I am still alive, just very busy with some cool things that have been happening in my life. I will share in the next couple of weeks.

August 6, 2008 · 1 min · 66 words · Nick Berardi

X-Files: I Want To Beleive... Meh...

Last night I saw the new X-Files Movie, I Want To Believe, and as a fan of the original series and movie, I had great expectations for this movie. In the normal series and the first movie, Mulder and Scully were assigned by the FBI to investigate the X-Files, or cases that couldn’t be explained by normal science. Which usually involved humans with special abilities, government cover-ups of paranormal activity, and extra-terrestrials. However this movie didn’t have anything do do with any of that, and the script seemed more politically driven, than to actually answer questions from the fans of the original series, it didn’t even seem to be a continuation of the original series. ...

July 26, 2008 · 4 min · 667 words · Nick Berardi

Do your self a favor get Opera 9.5 Mobile

I just downloaded Opera 9.5 Mobile for my Windows Mobile phone. And I have one thing to say. Wow! This brings a more standard compliant browser to your phone to replace the aging Pocket Internet Explorer. Opera 9.5 Mobile event beats the iPhone version of Safari in the ACID 2 and ACID 3 tests, so it is an amazing experience to finally get the full web, as it was intended, on my mobile device. ...

July 20, 2008 · 4 min · 693 words · Nick Berardi

Review of NDepend

When I was asked to review NDepend I didn’t want to do just another review. Because there are plenty of great reviews and I would just be adding to the noise. So I am going to use this time to give a personal story of how NDepend has helped me restructure some code I have been working on. As you are probably aware I have been working on a start up, called IdeaPipe, we have been going full steam ahead since January 2008 to get IdeaPipe to the point where it is today. Going at that break neck speed for almost 6+ months has left some raw spots in the code, that I have been putting off. Because lets face it even though they are not optimal, they are returning the correct results. Just like a rough draft for a book it is better to get all the way through it and get a good picture of the entire story as a whole, and go back and rework the spots that were created inorder to advance the storeline. The same is true for software. ...

July 16, 2008 · 2 min · 341 words · Nick Berardi

iTunes 7.7 + Windows Vista x64 == OK

iTunes 7.7 has been released! Windows Vista x64 I am happy to announce that iTunes 7.7 and Windows Vista x64 work well together. The Apple downloader even chooses the correct 64-bit version of iTunes through every browser that I have tried, so they obviously fixed something where you don’t need to download iTunes through the 64-bit version of IE. No word yet if the iPhone 2.0 or 1.0 will work with the 64-bit version of windows. ...

July 10, 2008 · 1 min · 174 words · Nick Berardi

Ladies Night on Coder Journal

I received a ton of nice comments from Rob, John, Scott, and Phil related to my previous post, What Software Bloggers Do Girls Like Better? Phil even did a nice follow up post, with some good humor gloating, until the end where his wife let the air out of his sails; like only a wife can do. The day I posted the article, Scott instant messaged me to say good job on the article. During the conversation he mentioned that I should compare the stats to Oprah.com as a base point for the other statistics. So naturally I thought this would be a good follow up article. ...

July 7, 2008 · 2 min · 342 words · Nick Berardi

Which Software Blogger Do Girls Like Better?

Today I received an invite to Google Ad Planner. As I was playing around with this new tool, I was really blown away by how much information Google has collected on specific websites. So much so that I wanted to share this tool with my readers, but I couldn’t come up with an interesting way to demonstrate the capabilities. Until I started looking up some of my favorite bloggers and saw the almost embarrassing balance between females and males. ...

June 27, 2008 · 3 min · 515 words · Nick Berardi