I have a project that I have been creating and I have published it in the IIS, everything is fine there, I can visualize my Crystal Reports.
Now in republishing the project again (refreshing in IIS), but I can't see my Crystal Reports that I call from js, I'm calling it using this:
var url = "/ReporteIngresoVP/RPVistaPreviaIngreso";
window.open(url, "_blank");
When I call it, it opens a new tab (as it should be) and shows me a 404:
When I open another report (from the controller) it shows me the path
correct one:
According to what I read out there, if I need to use urls that point to elements that asp.net MVC
should go with it, that's @Url.Action
why I'm trying the following:
var url2='@Url.Action("RPVistaPreviaIngreso","CustomerReporteIngresoVP")';
window.open(url2, "_blank");
But when browsing I get the URL like this:
How can I complete the route or that I can go to the view that I want in javascript?
What I did to solve it and it may help someone:
Create a div that has nothing, just a
class
anddata-request-url
in this last step my@Url.Action()
In JS capture the value of
data
the one in thediv
Works for both in Visual Studio and in a published project