SurfaceController - how to return to page with Jav...
# help-with-umbraco
m
I have a Payment form in a ViewComponent, with another hidden form below it (ie, hidden fields and submit button hidden by CSS). The SurfaceController is supposed to return to this page, populate one of the hidden fields and submit the form to Opayo (sagepay). In Umbraco 7 we had something like this:
Copy code
cs
return JavaScript(String.Format("$(\"input[name='Crypt']\").val(\"{0}\");$('input#sagepay-button').show();$('p#sagepay-message').show(); $('#SagePayForm').submit();", Crypt));
Tried this in U10:
Copy code
cs
string javascriptCode = String.Format("$(\"input[name='Crypt']\").val(\"{0}\");$('input#sagepay-button').show();$('p#sagepay-message').show(); $('#SagePayForm').submit();", Crypt);
return Content(javascriptCode, "application/javascript");
But it just shows the JS code on the screen.
return CurrentUmbracoPage
does not allow parameters. How would I do this?