2

I want to open a new url, pasing parameters using jquery, this is the way that im doing it,

  $('#BtnPrintFlujo').click(function(e) {

       var url = '@Url.Action("BillingxCashier", "Reports",new {area="Configurations" })';
       url += "/opParam=" + $("#Users option:selected").val() +
                    "&fromDate=" + $('#FromDate').val() +
                    "&toDate=" + $('#ToDate').val();

       var win = window.open(url);

       if (win) {
          win.focus();
       } else {
                    alert("Porfavor, debes permitir que se abran las ventanas emergentes o el reporte no va a salir :'( ");
               }
            });

but, it said this error

 Request.Path dangerous on the client (&).
0

1 Answer 1

2
 $('#BtnPrintFlujo').click(function(e) {

       var url = '@Url.Action("BillingxCashier", "Reports",new {area="Configurations" })';
       url += "?opParam=" + $("#Users option:selected").val() +
                    "&fromDate=" + $('#FromDate').val() +
                    "&toDate=" + $('#ToDate').val();

       var win = window.open(url);

       if (win) {
          win.focus();
       } else {
                    alert("Porfavor, debes permitir que se abran las ventanas emergentes o el reporte no va a salir :'( ");
               }
            });

you missed an question mark before first parameter,

url += "?opParam=" + $("#Users option:selected").val() +

try this

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot, i was thinking than it works exactly like a normal url, where i pass the id,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.