Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you call a C# function from JavaScript? [duplicate]

Possible Duplicate:
Call ASP.NET function from JavaScript?

"Can you call a C# function from JavaScript?" was asked by an interviewer. Is it possible? If yes, then how?

like image 807
Govind Malviya Avatar asked Oct 22 '10 05:10

Govind Malviya


People also ask

Can you call C from C++?

Just declare the C function extern "C" (in your C++ code) and call it (from your C or C++ code). For example: // C++ code. extern "C" void f(int); // one way.

Can C and C++ be mixed?

The C++ language provides mechanisms for mixing code that is compiled by compatible C and C++ compilers in the same program. You can experience varying degrees of success as you port such code to different platforms and compilers.

Is C or C++ faster?

Execution speed - C++ is often faster than C, because templates are a better solution to generic code than C's tendency to use function pointers. See C++'s std::sort vs C's qsort for a widely benchmarked example.


1 Answers

You can, but not directly. You'd have to use an AJAX implementation or write an AJAX call yourself using the XmlHttpRequest.

like image 150
KBoek Avatar answered Sep 21 '22 00:09

KBoek