Can use javascript in C # window

I want to use AJAX and javascript in windowing platform ... can I use it in window vs 05 c #?

+1


a source to share


5 answers


The options I know about are:

  • JSC.exe
    You can compile Javascript into a managed assembly and name it the same as any .NET assembly.
  • COM
    You can package Javascript logic as COM and call it from .NET or from any COM environment. An example .


EDIT . This allows Javascript, but not AJAX. AJAX is a term that is specifically applied to browsers, primarily using Javascript to retrieve information and potentially dynamically refresh the browser page without explicitly refreshing the page. This usually doesn't make sense in a Windows Form application built in C #, because you have C # and asynchrony is built into the .NET framework.

+4


a source


Erm - AJAX is simply the name of the technologists and templates used to make HTTP requests in Javascript. Javascript itself will work in any Javascript engine; most browsers are built into one, and you can also use the standalone Rhino engine (although many Javascript will use a browser environment that can get flaky).



C # is not Javascript, and as far as I know, Visual Studio is not a Javascript interpreter. Why are you trying to do this?

+1


a source


You can just add System.Windows.Forms.WebBrowser to your application, move it to any HTML + JS page you want, and do whatever AJAX you want there.

+1


a source


You cannot use JavaScript / JScript to write code as part of a Windows Forms Application. It seems you are after asynchronous data transfer (posh;) / AJAX that will need to be implemented separately. Also, if you want to provide a scripting language to your users, try IronPython

For a more detailed answer, specify in the assignment the specific piece of JavaScript that you would like to use, and we will provide alternatives.

EDIT : Oh. You can! Take a look at the answer above.

0


a source


You can use Rhino javascript engine powered by IKVM

0


a source







All Articles