我们导航到新的Call Server Side控件,然后单击Get User按钮(该按钮将调用刚刚添加的UserController.cs),并且它不会检测到已登录的用户。 要解决此问题,请将CallServerSide.razor页面中的GetUser方法更改为以下内容: async Task GetUser() { // Code courtesy from Oqtane.org (@sbwalker) // We must pass the...
Call gRPC service Server response: @serverResponse @code { string yourName = "Bert"; string serverResponse; async Task GetGreeting() { var request = new HelloRequest { Name = yourName }; var reply = await GreeterClient.SayHelloAsync(request); serverResponse = reply.Message; } } 现在在...
我们使用以下代码添加一个新的.razor页面CallServerSide.razor: 1@page"/CallServerSide"2@using BlazorCookieAuth.Controllers3@using System.Net.Http4@inject HttpClient Http5@inject NavigationManager UriHelper6@inject Microsoft.AspNetCore.Http.IHttpContextAccessor HttpContextAccessor7Call Server Side8Current User...
blazor server | Call Async function from blazor component Article 08/05/2020 Question Wednesday, August 5, 2020 1:55 PM how do i call this async function properly from blazor syntax? Blazor component: Copy LoginTest //The await operator can only be used in an async method. @if (await...
我们使用以下代码添加一个新的.razor页面CallServerSide.razor: 1@page"/CallServerSide"2@using BlazorCookieAuth.Controllers3@using System.Net.Http4@inject HttpClient Http5@inject NavigationManager UriHelper6@inject Microsoft.AspNetCore.Http.IHttpContextAccessor HttpContextAccessor7Call Server Side8Current User...
publicoverrideTask<HelloReply>SayHello(HelloRequest request, ServerCallContext context) { varreply =newHelloReply { Message =$"Hello from gRPC,{request.Name}!"}; returnTask.FromResult(reply); } } 这个类继承自 Greeter.GreeterBase ,它是从 .proto 文件自动生成的。因此,当你将新断点添加到 .proto ...
leafletblazorblazor-server-sideblazor-client-sideblazor-webassembly Isa*_*aac lucky-day 1 推荐指数 1 解决办法 6501 查看次数 反序列化 HttpResponseMessage 我有一个 API (asp net core 3.1) 和一个 Web 应用程序 (asp net Blazor WebAssembly)。在我的 API 中,我有一个 CustomerController,其 POST 方法...
{ "AzureAd": { "Instance": "https://login.microsoftonline.com/", "Domain": "{TENANT DOMAIN}", "TenantId": "{TENANT ID}", "ClientId": "{SERVER API APP CLIENT ID}", "CallbackPath": "/signin-oidc", "Scopes": "{SCOPES}" } } 範例...
[Authorize] @inject Greeter.GreeterClient GreeterClient Invoke gRPC service Call gRPC service Server response: @serverResponse @code { private string name = "Bert"; private string? serverResponse; private async Task GetGreeting() { try { var request = new HelloRequest { Name = name }; v...
asp.net-identity blazor blazor-server-side Bug*_*ver lucky-day 1推荐指数 1解决办法 487查看次数 获取当前用户 Blazor webassembly 的 UserId 所以我正在编写一个带有 asp.ner 核心标识的 Blazor webassembly 应用程序。我需要获取当前用户的 ID,而不是 Identy 中的方法提供的用户名。 方法 语境。用户....