Translate

Thursday 17 July 2014

Passing values from C# Code Behind to JavaScript.

You can use var variable name = "<%=this.variable%>"  to get value from aspx.cs. Variable must be public , protected in aspx.cs file.

For example, you can use: var date=”<%=DateTime.Now%>”;  to get the server time.