Published on

Sitefinity Controller ActionResult not routing properly

Authors

I just burned so much time on this I thought I’d write it out in case someone else googling around might find it useful.

So basically I had a page and dropped an widget (Controller) I made onto it. It had an Index method and a Save method which I was trying to HttpPost back to. The problem was the route wasn’t ever being hit. Was driving me crazy, so first I played around with the post data maybe that’s why it wasn’t being seen… nope. Next I removed the HttpPost and tried to just /mypage-with-widget/Save to see if it could render on a regular HttpGet; nope.

Maybe it needs for some reason [RelativeRoute], nope that prevented the entire widget even rendering at all. What threw me most is that this is the first widget I’ve ever made using the VisualStudio UI to create the files instead of just making it by hand from scratch. I figured maybe it was adding something somewhere that make it behave weird in Sitefinity.

Long story and about 3 hours of trying things later, it wasn’t the widget at all, or the page permissions or anything.

Edit the Page PROPERTIES, find the "Allow parameter validation" checkbox, and make sure it's checked.

That’s all it was, after all that troubleshooting.

The thread I posted to the forums can be found here

Boost your online presence.

Let us create the perfect digital experience for your company.

Contact us now