From a view razor
I can call links with this
window.location = '@Url.Action("ReporteDictaminaciones", "Auditoria")' + '?Auditor=' + auditor
Passing it to a JavaScript file stops working.
Any Solution?
From a view razor
I can call links with this
window.location = '@Url.Action("ReporteDictaminaciones", "Auditoria")' + '?Auditor=' + auditor
Passing it to a JavaScript file stops working.
Any Solution?
One solution (not the most precious one) would be to save the content in a variable within the view and then use it in the js file.
Code in the view:
<script type="text/javascript">
var myURL = '@Url.Action("ReporteDictaminaciones", "Auditoria")' + '? Auditor=' + auditor;
</script>
Code in js file:
function () {
alert(myURL);
}
The opposite of this is that you have to define this variable in all the views that use the js file (or the function in question).