blazor

How to call a razor page from a Blazor component in a Server Side Blazor Application without causing a page refresh

佐手、 提交于 2019-12-20 04:56:06
问题 I am developing a Blazor Server Side Application which I need to include cookie authentication. We created a custom login page component, but in order to create a cookie I need to call a Razor page to create the cookie. Is there a way to call the razor page without doing a page refresh. I tried using the UriHelper.NavigateTo but does not work with non Blazor component routes. Then I tried with a Javascript call to do a window.location, but the issue is that this causes a browser refresh that

Blazor Request blocked by CORS policy on PHP API

一笑奈何 提交于 2019-12-14 02:43:16
问题 I am setting up a PHP API and a web-page based on client-side Blazor. But for some reason CORS is triggered and my login process or any requests to my PHP pages result in CORS errors. I started out testing my PHP API with a C# console app and the Blazor app, I tried using without any database access to test the functionality. The Blazor is right now running with Preview 9. The PHP version is 5.3.8. I could in theory update it, but several other active projects are running on it and I do not

Blazor WebAPI to Client deserialization exception (PocoJsonSerializerStrategy)

為{幸葍}努か 提交于 2019-12-13 23:55:59
问题 I am able to generate a proxy (using VS 2017) via the Microsoft OData Connector Service Nuget. This generates the proxy just fine. However, when i try to send a entity over the wire to the client side, i get a deserialization exception. Is there any technical issues using service reference/proxy generated entities/data-models? Below is the exception i was able to capture when the payload is retrieved from my Web API to the client. System.Reflection.TargetParameterCountException: Number of

Whole blazor web app stop working when exception occured

╄→尐↘猪︶ㄣ 提交于 2019-12-13 20:16:29
问题 Please advice me any suitable solution for the following issue, when the blazor application throws any exception, the whole application goes down and no link is working, until I can run the application through studio again. what to do with this issue? thanks & best regards Edited (In order to provide requested info) Steps to reproduce: Create a blazorserverside app: Modify IncrementCount At Counter.razor : void IncrementCount() { currentCount += 1; _ = 0 / (5-currentCount); // <-- force error

How to make two-way binding on Blazor component

百般思念 提交于 2019-12-13 16:03:50
问题 I want to create custom input, so I created this component: MyInputComponent.razor : <div> <input type="text" @bind="BindingValue" /> </div> @code { [Parameter] public string BindingValue { get; set; } } Then the usage: <EditForm Model="model" OnValidSubmit="Submit"> <MyInputComponent BindingValue="model.Name" /> </EditForm> @code { User model = new User() { Name = "My Name" }; private void Submit() { // here I found model.Name = null; } } When I debug MyInputComponent , I found the value as

Problems with @using Microsoft.JSInterop in Blazor applications

二次信任 提交于 2019-12-13 11:06:05
问题 I have a client screen that I created using Razor View, it only has all CRUD options. The problem is when I create or change an account's ALL VIEW VIEW of Loading ... and this is not correct. Only Delete works perfectly, when I delete a client, only the registration table is updated The Controller was created with the Entity Framework option: API Controller with actions, using Entity Famework See the code for my Razor View. @using TesteBlazor.Shared @using TesteBlazor.Shared.Models @page "

Linq Entity Framework returning the value but not display

ε祈祈猫儿з 提交于 2019-12-13 07:57:17
问题 Linq Entity Framework return the value but not displaying mod = pron.Module.Include(x => x.Project).SingleOrDefault(x => x.ProjectId == id); value get but not displaying 回答1: I do not really understand your question but I think you want somethink like pron.Module.Where(x => x.ProjectId == id).Include(x => x.Project).FirstOrDefault(); 来源: https://stackoverflow.com/questions/56981798/linq-entity-framework-returning-the-value-but-not-display

Using FluentValidation to validate on a collection of Fields (rather than on a validator model)

流过昼夜 提交于 2019-12-13 02:53:55
问题 Im trying to see if there is a way to using FluentValidation without explicitly creating a validation model for every object type in my application. Is this technically and currently possible? Updated To rephrase this, is it possible for FluentValidation to validate Rules WITHOUT a IValidator context? Instead, i would like to pass in the item instance to be validated and use validation Rules which are constructed on-the-fly. Resolved I was able to resolve by doing a kind of a hack solution.

Run Blazor in Docker

巧了我就是萌 提交于 2019-12-12 12:31:09
问题 I've created my first Blazor test using Visual Studio 2019 (Preview). The repo is here. Everything works as expected when I hit the IISExpress button in VS. However, I'd like to deploy my app to an Ubuntu/Dokku server. As a result, I've been trying to figure out how I might setup my server using Docker. Here's what I have so far in my Dockerfile: # Latest .NET Core from https://hub.docker.com/_/microsoft-dotnet-core-sdk/ (not the nightly one) FROM mcr.microsoft.com/dotnet/core/sdk:3.0.100

Razor - How to determine RenderFragment Element name?

╄→尐↘猪︶ㄣ 提交于 2019-12-11 19:11:00
问题 I was creating simple razor component from existing html template. i want to make different conditions based on type of child given (from parameter) i have existing MenuItem and AnotherMenuItem component NavMenu.razor <ul class="nav navbar-menu"> <li class="nav-label">@Title</li> <!-- HOW TO CHECK ChildContent element type? --> @if(ChildContent is MenuItem){ @ChildContent }else if(ChildContent is AnotherMenuItem){ <div class="nav other-menu"> @ChildContent </div> }else{ } </ul> @code{