hi friends,
I think u can help me!!!!!!!!
How we can access a javascript function from a C#code file(.csFile)
and how we ca access a C# function from Javascript..........
*****Nice Pgmg***********************
Sree
JavaScript runs on the client's side...in their browser and the C# code runs on the server...
You cannot access a C# function using simple JavaScript.
You could insert some Ajax that will asynchronously post back to the server and call the C# function.
Likewise you cannot access a JavaScript function from C#.
You could put in a HiddenField that enables you to share data between your JavaScript and C# code.
Eg: Your JavaScript does some calculations and sets the value of the hidden field with it's results, the C# code can then retrieve the data from the hidden field and do further Server Side processing on the data.
You can generate JavaScript using C# code (as has already been suggested by the other posters); but, you cannot call JavaScript functions from C# code.
You can asynchronously call the C# functions using Ajax (not simple JavaScript)
Cheers!
-Frinny