Problem solve Get help with specific problems with your technologies, process and projects.

Share ASP.NET variables with JavaScript

Want to share ASP.NET variables with JavaScript? This Visual Basic code snippet will let you do just that.

Want to share ASP.NET variables with JavaScript? This Visual Basic code snippet will let you do just that.
<%@ Page Language="VB" Explicit="True">
<script runat="server">

  Dim sCurrentState As String

</script>

<html>
<head>
<script language="JavaScript">
<!--
  var currentState = <% Response.Write(CurrentState) %>;
  var pageIsPostBack = <% Response.Write(LCase(Page.IsPostBack)) %>;

// -->
</script>
</head>
<body>
</body>
</html>

Dig Deeper on ASP.NET development best practices

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

TheServerSide.com

Close