Click here to Skip to main content
15,846,211 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:

I am new to this HTML5 development. My question is - Is there a possibility to invoke C# method at run time ? So that my C# dlls can be reusable.

Please help me with some articles if any.


1 solution

What is your C# method doing? Generally, your C# code will all run on the server side, whereas HTML5 is associated with the client side.

If you want to use C# instead of JavaScript on the client side, you will need to use a cross-compiler, like SharpKit[^].

Imaging a calculator app that runs completely in the browser. C# is cross-compiled to JavaScript to provide the logic to make calulations when you press buttons.

If you want the client side to invoke a C# method on the server, you will need to put your C# code on a web site (ASPX or MVC) or behind a web service (REST, Web Service, WCF), then navigate to that page, or load it asynchronously with AJAX.

Image the calculator app, but no logic is done in the browser; each time you press + - / * = etc., a call is made to a server and the result is returned.
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