Can someone suggest how to use @URL.Action( "name", "controller", parameters} in your Jquery? Or atleat get the relative root to home directory.
I have to use JQuery get using the following code.
$(".ag").click(function () {
var id = this.id.replace("message_", "");
var cd = this.id.replace("message_", "display_message_");
$.get("/MRN/_Details_Message", function (data, status) {
document.getElementById(cd).innerHTML = "Data: " + data + "\nStatus: " + status;
});
});
The problem is that you cannot use @URL.Action
if your JS file is separate and if you google examples there are always complaints when using relative HTML paths with MVC.