Pass value from code-behind to JavaScript

666iky939

New Member
Trying to pass value (abc) from code-behind to JavaScript but the page fails and doesn't load. Is there something wrong with the syntax?\[code\]<script src="http://stackoverflow.com/questions/Scripts/jqModal.min.js" type="text/javascript"></script><script type="text/javascript"> $().ready(function() { }); $("a").click(function() { if (this.id == "optionalFeatures_Online") { var abc = "<%=Variable_codebehind %>"; } });</script>\[/code\]Code Behind On_Load event:\[code\] protected override void OnLoad(EventArgs e) { Variable_codebehind = "hello world"; }\[/code\]
 
Back
Top