ASP.NET MVC: Securing Your Controller Actions (The .NET Framework Way)

So I just read Rob Conery’s blog post on Securing Your Controller Actions in MVC. I was a little perplexed about why guys at Microsoft love to reinvent stuff they have already done. I know Rob Conery is a really smart guy and has a wonderful grasp of the .NET framework, so I would have to assume he knows about what I have outlined below. My only guess is that he just wanted to re-invent something that is already built in to the framework using his own code. ...

March 13, 2008 · 3 min · 461 words · Nick Berardi

ASP.NET MVC Preview 2 CAPTCHA using ActionFilterAttribute

My last article on ASP.NET MVC CAPTCHA was very well received by many of my readers and it even caught the eye of the DotNetKicks crowd. Now that MVC Preview 2 was released last week, many new features make encapsulating my CAPTCHA control even easier. Most notably is the ActionFilterAttribute which allows you to override the Pre and Post action events for any action the attribute is applied to. Basically everything works the same as it did in the previous article. I just modified things for MVC Preview 2. To validate the CAPTCHA you add the attribute CaptchaValidation to the action. ...

March 9, 2008 · 1 min · 203 words · Nick Berardi

ASP.NET MVC CAPTCHA

Note: Most recent update for MVC Release Candidate 3 is out. So my MVC application that I have been working on required a CAPTCHA today. The problem is that all of the solutions out there, that I could find for ASP.NET, are control based and I wanted a more MVC approach. I know I could have easily implemented one of them using the Html.RenderControl(), however I want to use a MVC approach to the CAPTCHA authentication box. So I started out with Jeff Atwood’s CAPTCHA Control made for ASP.NET 2.0 in VB.NET 2005. I then converted it to C# and modified and expanded on it for the MVC framework. The following is the result of my work. ...

March 3, 2008 · 3 min · 620 words · Nick Berardi

ASP.NET MVC Route Validation and SEO

Recently I have been using the ASP.NET MVC framework for a project at work. And one of the requirements was that certain data inputed in to the URL be tightly verified. I originally thought that data was verified by the type specified in the ControllerAction, however I came to find out that it wasn’t. So if you have say a page number and the user enters a letter in the URL the application just proceeds on it’s marry way. For example on the Kigg site: ...

February 27, 2008 · 3 min · 621 words · Nick Berardi

What I Learned About MVC On Day One

I am really blown back about how fast and easy MVC is to develop with. I know the guys at Microsoft do a good job with their .NET coding, but I am really impressed by the forethought they put in to MVC. It builds on top of the standard ASP.NET package, but does it in such a way that makes it lean on top of the already feature-rich (read bloated) ASP.NET Page object. It really doesn’t feel like I have all that baggage anymore. ...

February 25, 2008 · 1 min · 165 words · Nick Berardi

Nick Berardi's Essential Software for 2008

Every developer has their favorite tool collection that they must have in order to survive while developing software. The list below is indispensable in my day-to-day activities and that is why I am sharing it with my readers. My list was inspired by Scott Hanselman’s own list of tools that he uses. However I would be really interested to see what Scott’s actual list is since it would be almost impossible to touch each and every tool once a week as he claims. Because many of them serve the same purpose. ...

February 24, 2008 · 7 min · 1410 words · Nick Berardi

Best Practices for Production ASP.NET Applications

I would like to thank Kyle Beyer of Daptivate for putting this post together. This is a great resource for developers as well as server administrators. Some of what I think are the most critical steps for any production server I have pulled out below for your browsing pleasure. 1. Generate new encryption keys When moving an application to production for the first time it is a good idea to generate new encryption keys. This includes the machine validation key and decryption key as well as any other custom keys your application may be using. There is an article on CodeProject that talks about generating machineKeys specifically that should be helpful with this. ...

February 13, 2008 · 3 min · 596 words · Nick Berardi

How to use the .NET URL Rewriter and Reverse Proxy to run WordPress on IIS

First off I would like to say that many of my readers are very intelligent, they picked up on a one line sentence in my last post about my new design and Coder Journal switching from Linux to Windows. I also moved hosts from GoDaddy’s shared Linux hosting. To GoDaddy’s virtual dedicated hosting on Windows. This proved difficult since URL Rewriting isn’t currently built in to IIS 6.0 like it is in Apache. I will talk a little about this setup in a later post. ...

February 10, 2008 · 6 min · 1137 words · Nick Berardi

Does anybody have a name for this programming pattern?

Recently I have been working very hard on getting a new Web 2.0 initiative off the ground. With most new initiatives I like to start out by looking for software development patterns that will help me standardize my structure as well as make the programming experience common for any new members that are brought on the team. However I recently ran in to a structural “pattern” that seems like it is pretty simple and it addresses a common problem in software development. I researched as much as possible on all the common pattern websites that I visit and even went as far as posting on ASP.NET Forums to see if anybody could help me, give it a name. If this “pattern” hasn’t been named yet I am going to be shocked. ...

February 3, 2008 · 4 min · 832 words · Nick Berardi

Visual Studio 2008 and .NET 3.5 Released

Scott Guthrie has announced that Visual Studio 2008 and .NET 3.5 are now available for download and provides a tour of some of the new features. If you are a MSDN subscriber, you can download your copy from the MSDN subscription site (note: some of the builds are just finishing being uploaded now - so check back later during the day if you don’t see it yet). If you are a non-MSDN subscriber, you can download a 90-day free trial edition of Visual Studio 2008 Team Suite here. A 90-day trial edition of Visual Studio 2008 Professional (which will be a slightly smaller download) will be available next week. A 90-day free trial edition of Team Foundation Server can also be downloaded here. If you want to use the free Visual Studio 2008 Express editions (which are much smaller and totally free), you can download them here. If you want to just install the .NET Framework 3.5 runtime, you can download it here.

November 19, 2007 · 1 min · 163 words · Nick Berardi