Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In asp.net,how to pass-value and call the function between C# and javascript?Thank you.
Posted
Updated 29-Aug-12 5:46am
v2
Comments
Sandeep Mewara 29-Aug-12 12:02pm    
You mean C# from JavaScript OR JavaScript from C# ?

Hi,

Calling your javascript function from C# code is not difficult. And To pass value from C# to Javascript function is like passing parameter in the javascript function. if you have more parameters to pass and it is not possible to pass it though the function argument then you can use HiddenField to store your value. You can read HiddenField from the Javascript.

See This[^] discussion for passing parameter in javascript function from codebehind.

Hope this is what you want,

Thanks
-Amit Gajjar
 
Share this answer
 
Using Hiddenfield you can pass value between C# and javascript
 
Share this answer
 
Comments
pucx 30-Aug-12 7:24am    
Hiddenfield ?how to use Hiddenfield ?
Use page.registerclientscriptblock from c# code
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900