I need to get multiple variables up into my JS code from my C# backend (ASP 2.0). Currently I use the following code
string js;
if (swapSize == null && VMWare == null)
js = "var stackedUnknownExemptCheck = " + stacked.ToString().ToLower() + ";";
else if (VMWare == null)
js = "var stackedUnknownExemptCheck = " + stacked.ToString().ToLower() + "; var swapSize = " + swapSize.ToString() + ";";
else if (swapSize == null)
js = "var stackedUnknownExemptCheck = " + stacked.ToString().ToLower() + "; var VMWare = " + VMWare.ToString().ToLower() + ";";
else
js = "var stackedUnknownExemptCheck = " + stacked.ToString().ToLower() + "; var VMWare = " + VMWare.ToString().ToLower() + "; var swapSize = " + swapSize.ToString() + ";";
Page.ClientScript.RegisterStartupScript(this.GetType(), "", js, true);
However, the output always ends up just being the first variable up to the semicolon (see below). Is there anyway to make sure all the variables get uploaded? Thanks.
<script type="text/javascript">
//<![CDATA[
var clusterMS = false;//]]>
</script>