Can you call a C # function from JavaScript?

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?

+5
source share
5 answers

You can, but not directly. You will need to use an AJAX implementation or write an AJAX call yourself using XmlHttpRequest.

+7
source

' . . . call serveride javascript, AJAX, - ASP.NET AJAX.

" " PageMethods ASP.NET AJAX

+4

# JavaScript, . . -, , .

  • REST. , ASP.NET MVC.
  • - ( ). Ajax Microsoft, .
+3

# ( - ) 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 ...".

+1
source

Yes, you can. Check Page Methods .

+1
source

All Articles