I'm using XP 10.1 & XC 10.1

The following way used to work in earlier versions of XP.

using (Ajax.BeginForm("SaveContactUsFormData", "ContactUsForm",
                                new AjaxOptions
                                    HttpMethod = "Post",
                                    OnSuccess = "OnSuccessContactUs",
                                    OnFailure = "OnFailureContactUs",
                                    LoadingElementId = "divLoading"
    <button type="submit">Submit</button>

But now it renders the form action url as - /api/cxa/ContactUsForm/SaveContactUsFormData
I'm expecting the url should be - /api/sitecore/ContactUsForm/SaveContactUsFormData. Is that correct or has it changed for commerce (or xp 10.1).

The controller method is not triggered on debug and the button click is doing a postback instead of an asynchronous call.


The code in the action method does execute without any errors.

  • Yes it is correct, OOTB calls will go through api/cxa but if you want to change you need to use routing Commented May 5, 2021 at 4:15
  • Also can you check Network tab of browser and see what is the output of this call? Commented May 5, 2021 at 4:26
  • @GauravAgarwal But the default /api/cxa is not hitting the controller method. When you say "if you want to change.." is there any way to still make it work without changing route or what would be the solution. Thank you.
    – sukesh
    Commented May 5, 2021 at 5:35

1 Answer 1


Set "IsCxaSite" to true in "Site Grouping" item for that SXA site and then try to trigger cxa api's.

enter image description here

  • It is already set to true.
    – sukesh
    Commented May 5, 2021 at 6:31
  • Does Controller which you are try to hit inherit SXA's StandardController? Commented May 5, 2021 at 6:42
  • It's System.Web.Mvc Controller. The breakpoint is not hit and also the button click is doing a postback. Surprisingly, the code in the controller method is executed fine and data getting saved.
    – sukesh
    Commented May 5, 2021 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.