Last post Jun 26, 2018 08:04 AM by mudassarkhan
Member
4 Points
66 Posts
Jun 26, 2018 04:38 AM|sidu|LINK
Hi all
when i click button btnAdd i need to cal method from Home controller How can i do it
$("#btnAdd").click(function () { $("#myModal").toggle("slow");
// here i need to cal nethod index1 from home controller how i need to call
});
please help me
All-Star
28988 Points
7251 Posts
Jun 26, 2018 04:49 AM|Rajneesh Verma|LINK
Suppose you have Index1 method as below
public string Index1() { string res = "this is return value from Index1 action"; // do here some operation return res; }
Now call using jQuery
$.post("/Home/Index1",null, function (data) { alert(data); });
Other possible options : Link
54508 Points
14111 Posts
Jun 26, 2018 08:04 AM|mudassarkhan|LINK
Refer
ASP.Net MVC: Call Controller Method from jQuery without AJAX
ASP.Net MVC: Call Controller Method from View using jQuery AJAX
Member
4 Points
66 Posts
call the method from Homecontroller in mvc in asp.net from ajax jquery
Jun 26, 2018 04:38 AM|sidu|LINK
Hi all
when i click button btnAdd i need to cal method from Home controller How can i do it
$("#btnAdd").click(function () {
$("#myModal").toggle("slow");
// here i need to cal nethod index1 from home controller how i need to call
});
please help me
All-Star
28988 Points
7251 Posts
Re: call the method from Homecontroller in mvc in asp.net from ajax jquery
Jun 26, 2018 04:49 AM|Rajneesh Verma|LINK
Suppose you have Index1 method as below
Now call using jQuery
Other possible options : Link
www.rajneeshverma.com
All-Star
54508 Points
14111 Posts
Re: call the method from Homecontroller in mvc in asp.net from ajax jquery
Jun 26, 2018 08:04 AM|mudassarkhan|LINK
Refer
ASP.Net MVC: Call Controller Method from jQuery without AJAX
ASP.Net MVC: Call Controller Method from View using jQuery AJAX
Blog: ASPSnippets | Forum: ASPForums | Company: Excelasoft