How to send and receive data from Angular to Maui C# and and vice versa?

Jseh R 1 Reputation point
2022-09-02T05:33:30.11+00:00

I followed this link https://learn.microsoft.com/es-es/events/dotnetconf-focus-on-maui/upgrade-your-js-app-to-native-with-dotnet-maui where it explains how to use a maui-blazor project to load an angular application, but it does not explain how to communicate C# to JS and vice versa. Can someone help me? please

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,696 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 33,091 Reputation points Microsoft Vendor
    2022-09-05T05:43:16.577+00:00

    Hello @Jseh R ,

    You could refer to the document- ASP.NET Core Blazor JavaScript interoperability (JS interop) | Microsoft Learn, it explains general concepts on how to interact with JavaScript in Blazor apps.
    For more details, please see:
    Call JavaScript functions from .NET methods in ASP.NET Core Blazor | Microsoft Learn
    Call .NET methods from JavaScript functions in ASP.NET Core Blazor | Microsoft Learn

    In addition, there is a sample at GitHub, you can check the source code.

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.