More in this section
Forums / Bugs & Issues / MVC Widget retuning 404 on View Change

MVC Widget retuning 404 on View Change

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 2 answered
  1. Celso
    Celso avatar
    6 posts
    03 Jul 2015
    31 Aug 2015
    Link to this post


     I've been developing an MVC widget which will be used to test some third-party integration functionality.

    However, I'm having a lot of trouble making the returned view be recognized.


    So, I have my Controller with the following code:

    01.public class PayExTesterController : Controller
    03.    /// <summary>
    04.    /// This is the default Action.
    05.    /// </summary>
    06.    public ActionResult Index()
    07.    {
    08.        var model = new PayExTesterModel();
    10.        return View("Default", model);
    11.    }
    13.    public ActionResult Redirect()
    14.    {
    15.        var model = new PayExTesterModel();
    16.        return View("Redirect", model);
    17.    }


    Also, my Default view all it does is have a button to call the Redirect method:

    2.    @using(Html.BeginFormSitefinity("Redirect", "PayExTester"))
    3.    {
    4.        <input type="submit" value="Go" />
    5.    }

    , which will then call the Redirect View:

    1.@model SitefinityWebApp.Mvc.Models.PayExTesterModel
    2.@using Telerik.Sitefinity.UI.MVC;
    3.@using Telerik.Sitefinity.Frontend.Mvc.Helpers
    6.    Success!!

    However, whenever I click go, i get an 404 error. What am I doing wrong or what is wrong with my code?

    If I call from the Redirect View from within the Index method, everything works as expected (I get the Redirect view) bot not when that happens as a result of a call/action.


    Best Regards,

    Celso Santos

  2. Celso
    Celso avatar
    6 posts
    03 Jul 2015
    31 Aug 2015
    Link to this post
    So, basically, the problem was that I was missing an [HttpPost] notation on the Redirect method
2 posts, 2 answered