Strange issue when POSTing to MVC widget's controller ac

Posted by Community Admin on 04-Aug-2018 01:20

Strange issue when POSTing to MVC widget's controller action.

All Replies

Posted by Community Admin on 15-Dec-2015 00:00

I'm having trouble getting a POST request to a controller action in an MVC widget to function.  Running the project in debug allows me to see that the code in the action, and then in the view, is all run perfectly fine without any problem. But some time after the view finishes being run, Sitefinity returns a 404 instead of the view.  Can anyone help with this?  It's very urgent that we get this fixed and these kinds of issues seem to be constantly popping up with Sitefinity.

The problem is that the error is occurring after my code has already run, so I have no idea WHERE the real problem is.  There is no exception details or anything of the sort, so I have no clue where to even begin.

That said, when in Debug mode, after the view is rendered Visual Studio is asking me for the location of a file called "OpenAccessDataProvider_82b1799c64a76a459b11ff0000693a07.ascx"

What does this mean, am I missing a file somehow?

 

(I'm using Sitefinity v8.2)

 

Edit: Oh, and probably worth mentioning that the error occurs regardless of what I put in the action or the view, an empty action returning an empty view still produces this error.

See attached image for the 404 screen I'm seeing.

Posted by Community Admin on 17-Dec-2015 00:00

Really hoping someone can help with this?  These kinds of bug seem incredibly common in Sitefinity and always cause us major delays, and it's embarrassing having to explain to my managers why I suggested Sitefinity as our CMS when I'm constantly being held up by Sitefinity glitches.

Posted by Community Admin on 31-Jan-2016 00:00

Yep, i have the same problem, with my custom events, but... only with sites about like that:

urlMySite:port/Post/Post-About-something

'cause when i have the next example, my controllers works

urlMySite:port/MyCustomModule

Posted by Community Admin on 03-Feb-2016 00:00

Hi,

I have tried this on my end and the Post action is working as expected on my end. In fact there are several MVC widgets in Sitefinity that also utilize post actions. One such would be the MVC Form widget: https://github.com/Sitefinity/feather-widgets/blob/d66ba87970badca66e637bfda64def97ff9f7c5d/Telerik.Sitefinity.Frontend.Forms/Mvc/Controllers/FormController.cs

Would it be possible to share the code of the controller to inspect and try on my end. If you are concerned about sensitive information feel free to open a support ticket and share the code there.

Regards,
Velizar Bishurov
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 08-Mar-2017 00:00

I have the same problem. My controller action should be the same for both GET and POST, but i get the 404 error when I try to POST. I've tried creating a separate action but it is redundant and doesn't allow to have the same method signature. Setting the ActionName or Route attribute on the POST doesn't work. 

Is there a way to fix this? Or should I just give up on trying to work with MVC and learn Webforms instead?

=== EDIT ===

Found that setting EnableBackwardCompatabilityForPagesUrls to true in Advanced Settings for Pages solves the problem. 

This thread is closed