Guest User

Untitled

a guest
Feb 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. [WebMethod]
  2. public static JsonResult GetMaintZone(string ddlState)
  3. {
  4. DataTable dt = new DataTable();
  5. try
  6. {
  7. CommonDB ObjCommon = new CommonDB();
  8. dt = ObjCommon.GetMZONE(ddlState);
  9. }
  10. catch (Exception)
  11. {
  12.  
  13. throw;
  14. }
  15. return JsonResult(dt);
  16.  
  17. }
  18.  
  19. function getMZONEWithState(evt) {
  20.  
  21. var ddlState = $('#ContentPlaceHolder1_ddlState').val();
  22.  
  23. var ddlMaintenanceZone = $("#ddlMaintenanceZone");
  24.  
  25. ddlMaintenanceZone.empty().append('<option selected="selected" value="0" disabled = "disabled">State Loading...</option>');
  26.  
  27. $.ajax({
  28. type: "POST",
  29. url: "Dashboard.aspx/GetMaintZone",
  30. data: JSON.stringify({ ddlState: ddlState }),
  31. contentType: "application/json; charset=utf-8",
  32. dataType: "json",
  33. success: function (response) {
  34. //fill ddl
  35. },
  36. error: function (response) {
  37. alert('Something went wrong..!!');
  38. }
  39. });
  40. }
Add Comment
Please, Sign In to add comment