Groups | Blog | Home
all groups > dotnet general > march 2004 >

dotnet general : Getting variable of the codebehind in the JavaScript


Varun
3/5/2004 11:56:06 PM
I want to access the variable in the codebehind in the javascript
How can i do that

Suma
3/6/2004 12:16:05 AM
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
Varun
3/6/2004 12:41:06 AM
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

Suma
3/6/2004 1:41:08 AM

Cor
3/6/2004 9:25:40 AM
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



AddThis Social Bookmark Button