I am currently attempting to pass multiple parameters (eventually 4 total) into a JavaScript function from my ASP.NET code behind.
In the ASCX file, I have defined the function as follows:
function ToggleReportOptions(filenameText, buttonText) { /*stuff happens here*/ }
And in the ASCX.cs file, I have attempted to set the onClick attributes as such:
string testing123 = "testStringOne";
string testing124 = "testStringTwo";
optReportOptionsRunRealTime.Attributes["onClick"] = "ToggleReportOptions('" + testing123 + ", " + testing124 + "')";
optReportOptionsOffline.Attributes["onClick"] = "ToggleReportOptions('" + testing123 + ", " + testing124 + "')";
However, this implementation does not seem to work correctly. The output shows that the first variable contains "testStringOne, testStringTwo" and the second variable is "undefined".
If anyone could provide assistance in resolving my issue, it would be greatly appreciated. I am relatively inexperienced with JavaScript, more accustomed to .NET development.