Skip to main content

Questions tagged [ajax]

For questions related to the use of AJAX that are specific to Sitecore (i.e. not general AJAX questions that would be better suited for StackOverflow)

Filter by
Sorted by
Tagged with
9 votes
4 answers
8k views

Why is my Ajax url not recognizing my sitecore controller or hitting my breakpoint in my sitecore controller?

this is my markup: the ajax is supposed to get called when there is a change to my dropdown selection: this is my ajax jquery: <script> $("#AffiliateList").change(function (e) { ...
Paul T. Rykiel's user avatar
4 votes
3 answers
277 views

Why is my Ajax url found when I test in preview mode, but not when I bring up the page in a url I get not found errors

Update: this is what my url is trying to resolve to: /home/about us/api/sitecore/findanaffiliate/getaffiliate/ so here is my Ajax : <script type="text/javascript"> $("#AffiliateList")....
Paul T. Rykiel's user avatar
3 votes
2 answers
1k views

How do I redirect to another item in Sitecore

while this seems easy, it isn't working Here is my code public ActionResult RenderSelectedItem(string id) { var itemURL = Sitecore.Context.Database.GetItem(id); var link = ...
Paul T. Rykiel's user avatar
3 votes
1 answer
438 views

NullReferenceError for Html.Sitecore().Rendering in Ajax Calls

I need to update page renderings based on search results using ajax call. I have written a method to get rendering collection based on filter and when I call Html.Sitecore().Rendering via loop in view ...
User464's user avatar
  • 31
3 votes
2 answers
2k views

call to webmethod using ajax doesn't work [closed]

I have a webmethod [WebMethod] public static string GetVendorData(List<VendorData> LstVendorData) { //something } and call it from a ajax method $.ajax({ type: "POST", url:...
Komahan's user avatar
  • 49
2 votes
1 answer
856 views

Sitecore Ajax post returning same page

I've trying to make a POST request. It is returning the same page, i.e the whole HTML instead of the result I send via the Controller. @model kgSitecoreTraining.Models.BlogVotes <div class="blog-...
Joel Alvarez Myrrie's user avatar
2 votes
0 answers
56 views

Sitecore Forms onclick of back button clearing data

I have a country field in Sitecore Forms which gets data populated from AJAX call on page load. When I enter all the values in the form and navigation to next page all the fields looks fine. I am ...
Mamtha's user avatar
  • 65
2 votes
1 answer
440 views

Intermittent issues with the Sitecore Ajax Post request while invoking a MVC Action [closed]

I have an application running on Sitecore 7.5 where my code is invoking an MVC Action at client side. The action method is decorated with the [HttpPost] attribute. https://www.XYZ.com/api/sitecore/...
Abhi's user avatar
  • 31
1 vote
1 answer
272 views

Ajax Begin Form Api Route is different in 10.1

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", ...
sukesh's user avatar
  • 3,176
1 vote
2 answers
325 views

Sitecore Forms: Ajax is working on some pages but not on others for same form [duplicate]

I've got multiple pages that all use the same single form. I added the form to same additional pages of a different template. On the original pages, the form works as its supposed to - it shows the ...
Erica Stockwell-Alpert's user avatar
1 vote
4 answers
488 views

Unable to Call Controller in Ajax call

I want to destroy the session when the user clicks the fa-fa-close icon. I tried creating an ajax call and destroying the session. But when I call the ajax method this method throws an error. Can ...
Rajasekar's user avatar
  • 692
1 vote
0 answers
824 views

Ajax forms not working in Sitecore 9.3 [closed]

We have deployed the code files to a fresh 9.3 XP instance and the Ajax form renders differently. View: using (Ajax.BeginRouteForm(MvcSettings.SitecoreRouteName, null, new AjaxOptions { HttpMethod =...
sukesh's user avatar
  • 3,176
1 vote
0 answers
2k views

jQuery AJAX GET request returning “parsererror” error response message

In a scope of Sitecore Web project an API Contoller is used. Got the following response error message during jQuery AJAX GET API request: On a back-end side I use IHttpActionResult action method that ...
Vadzim Papko's user avatar
1 vote
0 answers
217 views

Restricting user from forcing manual submit to the Sitecore Url

Looking for the best practices to tackle a user behavior in my Sitecore 7.5 application. Basically there is an action method decorated with the [HttpPost] attribute. This action is invoked through ...
Abhi's user avatar
  • 31
0 votes
2 answers
7k views

How do I access Sitecore.Context.Item in normal MVC Controller

I have a normal MVC Controller (not a Sitecore Rendering) which I am calling in an AJAX request (from a Sitecore page). I need the current Sitecore item there. How can I access it there?
user3621's user avatar
  • 414
0 votes
0 answers
144 views

Base URL is not coming correctly in AJAX call on landing page of sub site

My current Sitecore project has a multisite with URL structure as follows www.MainSite.com www.MainSite.com/SubSite Whenever I do an AJAX call from the subsite landing page the base URL is coming as ...
shahul's user avatar
  • 47
0 votes
3 answers
242 views

Context.PageMode is not working in Experience editor

When I load the page in Experience Editor for the first time, I am able to get Context.pagemode.IsExperienceEditor as true. We have a few ajax begin forms on the page. When I call any method in the ...
Visva Kiruthika Muthuraj's user avatar
0 votes
0 answers
172 views

Submit WFFM via javascript ajax post without reloading the page?

I have a WFFM form on a page that has a lot of dynamic content. When the form is submitted, the page reloads (as a postback) to display the success message, which also reloads all of the content on ...
Erica Stockwell-Alpert's user avatar
0 votes
1 answer
216 views

Sitecore 7 Ajax call not working

I have only worked with Sitecore 8+ and for Ajax calls, all I do is this $.ajax({ url: '@Url.Action("ActionName", "ControllerName")', type: "POST", data: '{sampleModel: ' + JSON....
sukesh's user avatar
  • 3,176
0 votes
1 answer
250 views

Sitecore.Web.WebUtil.Redirect not working with Ajax call

I have an Sitecore app (9.0.2) MVC application, in which I send to the Controller a FormCollection object, with an Ajax call (because I create dynamically tabs with in View). On the Controller, I ...
iusmar's user avatar
  • 239
0 votes
0 answers
246 views

Calling component from another component via anchor link

I have a modal component which is basically a popup with some content in it. I have to ask if it is possible to link that component from another component. For example I have anchor link in another ...
user avatar