I have a public property in my code behind named Tab which I’m trying to access in the pages aspx file with javascript but I’m not sure how to get the right value.
This gives me the value I want
alert('<% Response.Write(this.Tab); %>');
This does not
var x = <% =this.Tab %>;
alert(x);
Any ideas?
If you view the source you are probably seeing
I would guess you want the quotes too
Instead of having code inline, why don’t you look at RegisterStartUpScript or RegisterClientScriptBlock.