How can I pass value from codebehind to javascript?
-
I need solution for passing value from server side code (codebehind) to client side code in javascript.:~
Inject the value into the javascript before you send it, or inject a hidden form field with the value and read it from the javascript. Do that with Page.RegisterHiddenField(HiddenFieldName, HiddenFieldValue); Access it with document.formname.HiddenFieldName
-
I need solution for passing value from server side code (codebehind) to client side code in javascript.:~
You can access direct your variable in codebehind don't need to use hidden field. You can declare a global variables in codebehind and in javascript you can access it. Example: //In the code behind declare a global variables of your page public string strVar = ""; // //In javascript you can access it by; var strVar = <%=strVar%>; Welcome to my website: www.qitt.com You can win if you want
-
I need solution for passing value from server side code (codebehind) to client side code in javascript.:~
H horwat, Perhaps this article should help you: http://www.codeproject.com/useritems/Rendering_ClientScripts.asp Deepak Kumar Vasudevan http://deepak.portland.co.uk/