I have a JavaScript Variable that is set in my ASP.NET page as follows
<script type="text/javascript>
var MyVarable = <%=ASPNETVarable%>;
$(document).ready(function () {
alert(MyVarable);
}
</script>
Now this is simplified and on the back end code ASPNETVarable is set as
protected string ASPNETVarable="My Backend Value";
The page loads & runs correctly, but in Visual Studio the line
var MyVarable = <%=ASPNETVarable%>;
Shows that it's a "Syntax error", while it works, how do I remove this "syntax error" ?
function myFunction_<%= this.ClientID %>() { [...] }to make the function name unique for the control itself. Basically, this error appears on all cases where you do not wrap your variable between'or". However everything compiles and runs fine as desired. Annoying error.