469,591 Members | 2,093 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,591 developers. It's quick & easy.

how to call c# variable form code behind into javascript function in html page

1
hi,

i work in asp.net2.0/c#.not much expert in javascript.i have a variable declared in the c# code behind page.assume the variable contains some value.

i have a javascript function in the <script> </script> area of the html source view of the corresponding aspx(asp.net)page.

my requirement is how do i access the variable which i mentioned above in the c# code behind page?i need to use the variable in the javascript function.

please show some light on how to get the variable from the c# code section to the javascript function which is situated in the html section......

please assist

thankyou in advance
supin
Apr 25 '07 #1
1 9646
Frinavale
9,735 Expert Mod 8TB
hi,

i work in asp.net2.0/c#.not much expert in javascript.i have a variable declared in the c# code behind page.assume the variable contains some value.

i have a javascript function in the <script> </script> area of the html source view of the corresponding aspx(asp.net)page.

my requirement is how do i access the variable which i mentioned above in the c# code behind page?i need to use the variable in the javascript function.

please show some light on how to get the variable from the c# code section to the javascript function which is situated in the html section......

please assist

thankyou in advance
supin

There is a function in .NET that lets you register a hidden field. You can then access the hidden field in your JavaScript.

Please review the information provided by MSDN on how to do this.

Cheers!

-Frinny
Apr 25 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by settyv | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.