Hi,
$.ajax({ type: "Post", url: "/Home/CalledMethod", data: data, success: function (result) { alert("Success!.."); } });
url: "/Home/CalledMethod", instead of this how can I use @url.action in jQuery ajax call inside javascript file
Thanks
R
Refer below links.
https://stackoverflow.com/questions/13640559/asp-net-mvc-url-action-in-external-js-file
https://forums.asp.net/t/1988989.aspx?Jquery+url+action+in+external+js+file+how+to+resolve
Replace Index with CalledMethod.
@Url.Action("CalledMethod", "Home")
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.