chromelyapps / Chromely

Build Cross Platform HTML Desktop Apps on .NET using native GUI, HTML5, JavaScript, CSS, Owin, AspNetCore (MVC, RazorPages, Blazor)
MIT License
2.98k stars 280 forks source link

Call c# function in JavaScrpit #304

Closed redaxol closed 3 years ago

redaxol commented 3 years ago

there is a way to call c# function in JavaScrpit and vice-versa

mattkol commented 3 years ago

@redaxol

To call JavaScript from C#: https://github.com/chromelyapps/demo-projects/blob/1cac58ffb95098223e206043ad9748c3f80dcea1/regular-chromely/CrossPlatDemo/app/pages/javascriptdemo.html#L71 https://github.com/chromelyapps/Chromely/blob/master/Documents/javascript_execution.md https://github.com/chromelyapps/demo-projects/blob/0ed0bf5a82ec196a9211ccacef85560aecfd11af/regular-chromely/CrossPlatDemo/Controllers/ExecuteJavaScriptDemoController.cs#L50

To call C# from JavaScript: Please see the demos - https://github.com/chromelyapps/demo-projects/tree/master/regular-chromely/CrossPlatDemo/app