in aspx code behind, define a var like:
Public rate as decimal;
then in page markup, put a control like:
<asp:HiddenField ID="myRate" runat="server" Value='<%=rate%>'/>
then in javascript try to test this value:
alert(document.getElementById('<%=myRate.ClientID%>').value);
it gave me the value as <%=myRate%>, not something like 0.01 in alert popup.
How to resolve this problem
Server tags aren’t evaluated in this case (which is why you see the literal text):
The easiest options are to set it in the code-behind:
or, unless it needs to be a server control, just use a hidden input:
And get it using that ID: