November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
This is an interesting subject so I did a quick search.
I found this post : Rest Service
Maybe it will help
This has got solved as below
var MyAppUrlSettings = {
MyUsefulUrl: '@Url.Action("Getresult","SamplePage")'
$.ajax({
url: MyAppUrlSettings.MyUsefulUrl,
............
Model PageType:SamplePage.cs
public virtual XhtmlString MainBody { get; set; }
Controller: SamplePageController.cs
public ActionResult Index(SamplePage currentPage)
{
PageViewModel model = new PageViewModel(currentPage);
return View(model);
}
public ActionResult Getresult(string sector) data = new List(Getvalues());
{
List
var objList = data.Where(a => a.Sector == sector).ToList();
return Json(objList, JsonRequestBehavior.AllowGet);
}
Index.cshtml
@model EPiServerSite1.Models.ViewModels.PageViewModel
When I created the page, I could see the options listed above on the page.
Based on the selection of item, I would need to call the 'Getresult' in the controller, the following script is working fine in a normal MVC
application, but the controller method(Getresult) is not hit in the episerver site when I put a breakpoint. Is the url path in EPiServer not the same
as we write in MVC?
What's the path to be entered in the jquery url to hit the action in controller in EPiServer?