Create a property in your code behind
protected string MyProperty { get { return "your value"; } }
then in javascript
var myValue = "<%= MyProperty %>";
More Related Contents:
- jQuery $(document).ready and UpdatePanels?
- how to parse a “dd/mm/yyyy” or “dd-mm-yyyy” or “dd-mmm-yyyy” formatted date string using JavaScript or jQuery [duplicate]
- Ajax request returns 200 OK, but an error event is fired instead of success
- How to do a Jquery Callback after form submit?
- ASP.NET postback with JavaScript
- how to use Protractor on non angularjs website?
- ScriptManager.RegisterStartupScript code not working – why?
- What is the best way to download file from server
- jQuery returning “parsererror” for ajax request
- TypeError: $(…).DataTable is not a function
- How to create a session using JavaScript?
- IE9 JavaScript error: SCRIPT5007: Unable to get value of the property ‘ui’: object is null or undefined
- How can I make window.showmodaldialog work in chrome 37?
- How to fire a button click event from JavaScript in ASP.NET
- HTML Alignment Issue in one machine only (both IE8)
- Reference ASP.NET control by ID in JavaScript?
- Calling ASP.NET Code Behind function from JavaScript
- Uploading File using Ajax in Asp.Net Core
- Can you tell JSON.Net to serialize DateTime as Utc even if unspecified?
- Accessing elements of JSON object without knowing the key names
- What algorithm does Readability use for extracting text from URLs?
- Check if a popup window is closed
- Confirm postback OnClientClick button ASP.NET
- Hook a javascript event to page load
- How to detect IE 11 with javascript in Asp.net
- Getting Textbox value in Javascript
- how to convert xml to json using jquery
- How to access a JavaScript variable from code behind in asp.net
- jQuery addClass onClick
- Add multiple window.onload events