/ Published in: C#
                    
                                        accessing getdev action of home controller which returns jsonresult
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
 $.ajax({ type: "GET", url: "/home/getdev", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { // Do something interesting here. console.log(msg); } });//ajax ends here public JsonResult GetDev() { return Json(new {author = "najam sikander awan", email="[email protected]"},JsonRequestBehavior.AllowGet); }
Comments
                    Subscribe to comments
                
                