Getting variable of the codebehind in the JavaScript

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to access the variable in the codebehind in the javascript
How can i do that

Varun
 
What is the exact need for referencing a codebehind variable in Javascript
you can have a control, say hidden textbox that always stores the variable value. Can then access this hidden input type in ur javascript
 
Hi Varun,

I would start, as I was you, with the answer from Suma.

Make a textbox, make it visible = false and enter the text value in your
page in that using your javascript.

Than you can get that as the
textbox.text in your code behind.

This is not the only possibility but surely the most simple to do.

Cor
 
I am assigning some values in the codebehind page and want to manipulate them value in the javascript
I feel hiddentext field is not a feasible for my problem i already had this idea
But it is not the feasible way to do as i want to atleast 20 variable of codebehind

Varun
 
Back
Top