Hi,
I am working ASP.NET MVC . I have a method like
public JsonResult Test(int i)
{
......
return Json(new {value= '100',
text='abc'
},JsonRequestBehavior.AllowGet);
}
I want to call above method and load that json result into igcombo controls
I tweaked sample from this page "http://igniteui.com/combo/aspnet-mvc-helper"
and tried below code but throwing error like "ReferenceError: Url is not defined"
$("#combo").igCombo({ dataSourceUrl: Url.Action('Test', new { i: 4 }), valueKey: "Value", dropDownAsChild: true, textKey: "Text" });
This page "http://igniteui.com/combo/aspnet-mvc-helper" example requires infragistics mvc dll
How to do this in jquery instead of using dll.
Regards,
Ashok
Hello Ashok,
You need to call the action method from the view using $.getJSON method. I suggest you to refer “Call An Action Method That Returns JSON “section in this link http://blog.bobcravens.com/2009/11/ajax-calls-to-asp-net-mvc-action-methods-using-jquery and assign the returned data to the igcombo datasource option.
Please let me know if you have any further questions regarding this matter.