Search code examples
c#javascriptwrapperfirebreath

call C# DLL in JavaScript


I need to call C# DLL from JavaScript.This JavaScript page is within the Firebreath framewok. The Flow should be C#-->Wrapper-->Firebreath(C++)-->JavaScript.

then How to call this C# DLL or Class from JavaScript? Please provide the solution for the same and let me know.


Solution

  • If DLL is a service. You only call it through JQuery ajax. Example:

    $.ajax({
      type:"POST" // Or GET
      data:"id=12&name=abc", 
      dataType:"xml", // Default type - text
      url:"/search/searchRecords", // URL of service
      success: function (data){ 
         // Do something
      }
    });
    

    See: http://api.jquery.com/jQuery.ajax/