I have this very simple C# function that builds a string that will be written to a html document - the string includes javascript code that will be executed by the browser once the final page is built is sent on its way. I am getting errors - New Line in Constant. I have done this type of thing 1000s of times. I have NOT tried using a StringBuilder class - string should work just as well. I tried escaping the single quotes into quotes (replaced all ' with /") - no luck. What am I missing?
Here is the function:
public string TranslateButtons()
{
string html = "";
html += "<div style='float:right;'>";
html += "<div id='translate-this'><a style='width:180px; height:18px; display:block;' class='translate-this-button' href='http://www.translatecompany.com/'>Translate Company</a></div>";
html += "<script type='text/javascript' src='http://x.translateth.is/translate-this.js'></script>";
html += "<script type='text/javascript'>";
html += "TranslateThis();";
html += "</script>";
html += "</div>";
return html;
}
The offending lines are the ones that include <script> or </script> - I even tried removing lines 1 by 1 - if I include any line with script tags I get the error.
Running: IIS 8.0 - Windows 8 - .NET Framework 4.0

@symbol?