It is possible if I define my variables in vb.net framework 2 to pass them to a function in javascript, test I have tried this:
<script type="text/javascript">
alert("<%=Rotulo.ID%>");
but I get an error, help friends
It is possible if I define my variables in vb.net framework 2 to pass them to a function in javascript, test I have tried this:
<script type="text/javascript">
alert("<%=Rotulo.ID%>");
but I get an error, help friends
In the end what I did was use the following Function:
Page.ClientScript.RegisterClientScriptBlock(Page.GetType, "initMyClientVariable", String.Format("var variable1 = '{0}'; var variable2 = '{1}'", System.Web.HttpUtility.JavaScriptStringEncode(valorvariable1), valorvariable2), True)
I put this in the load event of the page to set the variables before calling the javascript resource, that's very important.