Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peter Cort Larsen 421 posts 1038 karma points
    Apr 15, 2020 @ 08:36
    Peter Cort Larsen
    0

    Surfacecontroller

    Hi,

    I am trying to resolve a problem.

    The forms use surfacecontrollers, but sometimes we only get the JSON text, instead of the actual page.

    Example:

     public ActionResult UpdateCartAndContinue(List<BasketItem> model)
        {
            // TODO
            RedirectToUmbracoPageResult res = RedirectToUmbracoPage(1251);
            //return RedirectToUmbracoPage(1251);
            return Json(new { success = true, responseText = res.Url }, JsonRequestBehavior.AllowGet);
        }
    

    Sometimes it redirects correctly other times it shows, something like this:

    {"succes":true,"reponseText":"/dine-bestilling/information/"}
    

    I have no idea how to fix this, can anyone help?

  • Alex Skrypnyk 6175 posts 24176 karma points MVP 8x admin c-trib
    Apr 15, 2020 @ 10:08
    Alex Skrypnyk
    100

    Hi Peter

    I assume that it can happen when some js error occurred on your page and POST request to UpdateCartAndContinue performed by browser not by Js, and you see the result in the browser.

    Please, check browser console and be sure that you don't have errors on the page especially on the submit button event handler.

    Thanks,

    Alex

  • Peter Cort Larsen 421 posts 1038 karma points
    Apr 16, 2020 @ 17:18
    Peter Cort Larsen
    1

    Thx, it was some Js error

Please Sign in or register to post replies

Write your reply to:

Draft