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
4answers
6k 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) { ...
4
votes
3answers
173 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")....
3
votes
2answers
917 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 = ...
3
votes
2answers
1k 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:...
2
votes
1answer
654 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-...
2
votes
1answer
352 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 ...
2
votes
1answer
335 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/...
1
vote
0answers
142 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 =...
1
vote
0answers
737 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 ...
1
vote
0answers
144 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 ...
0
votes
2answers
4k 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?
0
votes
0answers
18 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 ...
0
votes
2answers
100 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 by creating an ajax call and destroy the session. But when I calling ajax method this method throws an error. Can ...
0
votes
1answer
71 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....
0
votes
1answer
96 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 ...
0
votes
0answers
70 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 ...