Ajax Method Call in ASP.NET MVC

Controller code here
  1. [HttpGet]  
  2. public JsonResult GetAjaxData(string newCode) {  
  3.     return Json(new {  
  4.         Status = "Ajax called succesfully", Message = "Message show succesfully"  
  5.     }, JsonRequestBehavior.AllowGet);  
  6. }  
View Code Here
  1. @ {  
  2.     ViewBag.Title = "Index";  
  3. } < script src = "~/Scripts/jquery-1.8.2.js" > < /script>  
  4. <script>  
  5. function AjaxCall()  
  6. {  
  7. $.ajax({  
  8. async: false,  
  9. url: $('#ajaxURL').val(),  
  10. type: 'GET',  
  11. cache: false,  
  12. data: {  
  13. newCode : "Put the data here"  
  14. },  
  15. success: function (result) {  
  16. if(result.Status !=''){  
  17. alert(result.Status);  
  18. }  
  19. else{  
  20. alert('Ajax called failed');  
  21. }  
  22. },  
  23. error: function (result, textStatus, errorThrown) {  
  24. alert(errorThrown);  
  25. }  
  26. })  
  27. }  
  28. </script > < div > < button value = "Ajax Called"  
  29. id = "btncalled"  
  30. onclick = "AjaxCall()" > Ajax Called < /button>  
  31. </div > @Html.Hidden("ajaxURL", Url.Action("GetAjaxData""Demo"))  
App_Start-> route config.cs code here
  1. public static void RegisterRoutes(RouteCollection routes) {  
  2.     routes.IgnoreRoute("{resource}.axd/{*pathInfo}");  
  3.     routes.MapRoute(  
  4.     name: "Default",  
  5.     url: "{controller}/{action}/{id}",  
  6.     defaults: new {  
  7.         controller = "Demo", action = "Index", id = UrlParameter.Optional  
  8.     });  
  9. }  
For better detail see the image which i have attached
 
Thanks