Is it possible to invoke a JavaScript function from within a view (cshtml) and transmit specific string variables (which are defined in the view) as parameters for the function call?
Assuming that the JavaScript function javascriptFunction expects 2 arguments. Normally, we would invoke it like this:
javascriptFunction('param1', 'param2')
. However, now I wish to supply it with some variables.
string y = "this is a string"
string x = "another"
javascriptFunction(y, x)
I attempted to use javascriptFunction(@y, @x), javascriptFunction('@y', '@x') but these approaches were unsuccessful