hi all,
can any one give me an idea how could i store a Asp.net Application variable by javascript.
can any one give me an idea how could i store a Asp.net Application variable by javascript.
<asp:HiddenField ID="myApplicationVarField" runat="server" />
function myFunction(){
var myApplicationVarField = document.getElementById('<%=myApplicationVarField.ClientID %>');
}
Dim theScript As New StringBuilder()
theScript.Append("function myFunction(){")
theScript.Append(Environment.NewLine)
theScript.Append(" var myApplicationVarField = document.getElementById('")
theScript.Append(myApplicationVarField.ClientID)
theScript.Append("');")
theScript.Append(Environment.NewLine)
theScript.Append("}")
'If you aren't using Ajax then you register the script with the Page:
Page.ClientScript.RegisterClientScriptBlock(Me.Page.GetType,"theScript",theScript)
'if you are using Ajax then you need to register
'the script with ScriptManager instead of with the page
Comment