How can I call a javascript function within a view(cshtml) and pass some string variables (defined in the view)to be used as parameters for the function call?
Say the function javascriptFunction uses 2 parameter. I will usually call it as javascriptFunction('param1', 'param2')
. But now I want to pass it some variables.
string y = "this is a string"
string x = "another"
javascriptFunction(y, x)
I have tried javascriptFunction(@y, @x), javascriptFunction('@y', '@x') but this does not work