I have a project that I have been creating and I publish it in the IIS, there everything is fine, I can visualize my Crystal Reports reports.
Now I have re-published the project (update in IIS), but I can not see my Crystal Reports reports that I call from js.
var url = "/ReporteIngresoVP/RPVistaPreviaIngreso";
window.open(url, "_blank");
At the time of calling 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 correct path(everything from IIS):
As I read out there if I need to use urls that point to asp.net MVC elements from js, they should go with the @Url.Action so I am trying the following:
var url2='@Url.Action("RPVistaPreviaIngreso","CustomerReporteIngresoVP")';
window.open(url2, "_blank");
But when I navigate, I get the URL in this way:
How can I complete the route or can I go to the view/controller what I want in both case, Visual Studio and the project published using javascript?
UPDATE
I try to navigate from a click function, I never pass any url, what can I modify?
$('.vpBTN').click(function () {
//OTHER DATA
$.ajax({
url: "setDatosIngreso",
method: "POST",
data: {
factura: datoFactura,
poliza: datosPoliza,
fecha: datosFecha,
via: datosVia,
bruto: datosBruto,
neto: datosNeto,
bultos: datosBultos
},
async: false,
//dataType: "json",
success: function (respuesta) {
var url = "IKOR/ReporteIngresoVP/RPVistaPreviaIngreso";
window.open(url2, "_blank");
}
});
});



Url.Actionhelper is not parsed there. Note that you cannot use Razor helpers inside external script file, you need to pass it as function parameter.window.open? Can you provide some details so that I can answer by using function parameter to pass the helper result? As mentioned before, you cannot do that unless the URL is passed as parameter first.ajax, I edit the question to include this<script>tag and then call the function which contains AJAX together with passed URL.