I am developing asp.net mvc project. I have a javascript object that sends query to controller action. in cshtml file I can use @Url.Action("get", "product") so when I publish the web site, url action is rendering by location url. If I publish it http://localhost/App1/, the action url is like this http://localhost/App1/product/get or I can publish it another directory like http://localhost/App2/ and so on.
But I have an issue in javascript code.
sample.js
function query(){
var url = "/product/get";
// send query this url
}
When I publish the project in http://localhost/App1/ url (APP1 folder), javascript query is sending request to http://localhost/product/get , but it should be like this http://localhost/App1/product/get
I can not use @Url.action() razor expression. How can I solve this issue?
query()?