Last Updated: February 25, 2016
· edtheprogrammer

MVC Actions Not Working In Sitefinity

Using MVC to build widgets in Sitefinity is new with version 5.1. It's pretty cool because you can have widgets (a.k.a. controls) built with MVC on the same page as webforms widgets. You can even use MVC widgets inside old fashioned webforms Master Pages. This is nice for my team since we have probably 20 custom widgets built using webforms that work well. We can create new functionality using MVC, whilst not breaking anything that currently works flawlessly.

I was making my first foray into Microsoft's ASP MVC when I hit a wall. None of my actionLinks were working. IIS kept giving me 404 errors whenever I tried to link to an action. It appeared to be treating the url as an actual URL and not an MVC route...or whatever the proper name for it is. After several hours of hacking around I chalked the problem up to the fact that I was using MVC 4 libraries (long story) , and Sitefinity only technically supports MVC 3.

Luckily the junior-est guy on my team was looking for something to do. So, I told him to figure out what the hell was going on while I moved onto another feature (like a boss). After a couple of hours he found the problem. It turns out you need to have the "Allow parameter validation" option selected in the Advanced Options section of any Sitefinity page the control sits in.

Big ups to JZ for figuring this out.