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)
21
questions
2
votes
0
answers
35
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 ...
0
votes
0
answers
109
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 ...
1
vote
2
answers
245
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 ...
0
votes
3
answers
210
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 ...
1
vote
1
answer
264
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",
...
0
votes
0
answers
165
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 ...
1
vote
0
answers
809
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
4
answers
449
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 ...
0
votes
1
answer
209
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
1
answer
237
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
0
answers
226
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 ...
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 ...
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?
1
vote
0
answers
214
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 ...
2
votes
1
answer
427
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/...
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:...
2
votes
1
answer
844
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-...
3
votes
1
answer
431
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 ...
4
votes
3
answers
270
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
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 = ...
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) {
...