BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
serverside public ActionResult DataSource(string titleValue) { var userTemplates = EmployeeRepository.GetAllRecords().Where(c => c.ContactTitle == titleValue).ToList(); var data = new List<object>(); foreach (var Cust in userTemplates) { data.Add(new { value = Cust.ShipCity, text = Cust.Country }); } return Json(data, JsonRequestBehavior.AllowGet); } Clientside:- function ValChange(e) { $.ajax({ url: '/Home/DataSource', type: 'GET', data: { "titleValue": e.text },//pass the selectedValue of the dropdown to server side success: function (data1) { $("#GridShipCity").ejDropDownList({ dataSource: data1, selectedItemIndex: 0});//assign the filtered dataSource obtained from serverSide } }) } |
script type="text/javascript"> //change event of the Designation dropdown. function ValChange(e) { $.ajax({ url: '/Home/DataSource', type: 'GET', data: { "titleValue": e.text },//pass the selectedValue of the dropdown to server side success: function (data1) { var ddl = $("#GridShipCity").ejDropDownList("instance"); $("#GridShipCity").ejDropDownList({ dataSource: data1 }); ddl.selectItemByText(data1[0].text); // assign the value for dropdown using selectItemByText } }) } } |