Possible duplicate:Call ASP.NET function from JavaScript?
"Can you call a C # function from JavaScript?" asked the interviewer. Is it possible? If so, how?
You can, but not directly. You will need to use an AJAX implementation or write an AJAX call yourself using XmlHttpRequest.
' . . . call serveride javascript, AJAX, - ASP.NET AJAX.
" " PageMethods ASP.NET AJAX
# JavaScript, . . -, , .
# ( - ) Silverlight JavaScript.
This is one of those difficult questions where the answer is "not directly, but with a little help from Ajax or the DOM web page, I can, and so I do it ...".
Yes, you can. Check Page Methods .