blazor

Blazor problem rendering data returned from Web Api

邮差的信 提交于 2019-12-24 00:44:55
问题 I'm hoping someone can suggest how I might figure out where this underlying problem is. I think it's serialization/deserialization not the grid. I am trying to render data returned from an ASP.NET Web Api using a Syncfusion Blazor Grid Component. The JliffDocument is from an open source library. Perhaps the fact that the object is made from composite types is a contributory factor but I can successfully serialize and deserialize the object graph within a unit test. E.g. TextElement implements

Calling function from generated button in Blazor

独自空忆成欢 提交于 2019-12-23 22:58:13
问题 I'm currently trying to call a method from some autogenerated buttons, that are set up from some configuration. So the number of buttons is configurable. I have the blazor page as shown below. My problem is that if I have 3 buttons and I press one then ButtonClicked is called correctly, but the index is always 3 - the end value of int i for the for -statement. I of course want the index of the button to be passed to the function. One obvious solution would be to wrap a button in my own

How do I use blazor server-side inside a razor component library using areas?

☆樱花仙子☆ 提交于 2019-12-23 12:56:19
问题 I have an existing .net core 3.0 preview 7 web application . My application is mainly razor-pages organized into areas eg. Admin, Sales, etc. I am able to successfully use a blazor component if I put it at the root of the application, however, if I move the component to an RCL I can access the component but it is not responsive (clicking the button for the counter example does not increment the count). I want to be able to go localhost/Admin/RazorPageContainingBlazorComponent or localhost

PreventDefault on Blazor input

為{幸葍}努か 提交于 2019-12-23 12:19:33
问题 I have a simple application with an input field that should insert a predefined piece of text as you type. The code I have looks like this: <input type="text" bind="@PetitionInput" onkeydown="@PetitionHandleKeyDown" /> @functions { private int _petitionCharStep = 0; private string _petition = "This is a dummy text"; public string PetitionInput { get; set; } = string.Empty; void PetitionHandleKeyDown(UIKeyboardEventArgs arg) { PetitionInput += _petition[_petitionCharStep]; _petitionCharStep++;

How can i get Javascript Callback in .Net Blazor?

≡放荡痞女 提交于 2019-12-23 11:49:25
问题 Is there a way to add callback to Javascript and get the result in Blazor? Apart from JS Promises. for example, let say i want to load a file Javascript Code window.readFile = function(filePath, callBack) { var reader = new FileReader(); reader.onload = function (evt) { callBack(evt.target.result); }; reader.readAsText(filePath); } Can i have something like this in Blazor C# // read file content and output result to console void GetFileContent() { JsRuntime.InvokeAsync<object>("readFile",

How can i get Javascript Callback in .Net Blazor?

青春壹個敷衍的年華 提交于 2019-12-23 11:49:11
问题 Is there a way to add callback to Javascript and get the result in Blazor? Apart from JS Promises. for example, let say i want to load a file Javascript Code window.readFile = function(filePath, callBack) { var reader = new FileReader(); reader.onload = function (evt) { callBack(evt.target.result); }; reader.readAsText(filePath); } Can i have something like this in Blazor C# // read file content and output result to console void GetFileContent() { JsRuntime.InvokeAsync<object>("readFile",

I have a formlayout error when running a Blazor website

半腔热情 提交于 2019-12-23 06:41:43
问题 I updated visual studio 19 and before that my site ran exactly how i intended it. Now i am getting an error when i load the home page but then breaks before it can finish loading it. I have provided the error code below. I also would let you know that i have seen this post ( How to turn on CircuitOptions.DetailedErrors? ) and tried it all but it hasn't worked. Information: Normalizing '_blazor' to 'http://fakesite.com/_blazor'. Error: There was an unhandled exception on the current circuit,

How to use subfolders in the Pages and Shared folders

牧云@^-^@ 提交于 2019-12-22 08:24:26
问题 I've got a Blazor Server-Side application. It has the folders Pages and Shared out-of-the-box. Since I have a lot of components in these folders, I wanted to distribute the components into multiple subfolders for a clearer structure. But if I do this, the components are not found and are not displayed in the GUI. What am I missing? Do I have to register the routes to the new subfolders somewhere? 回答1: You can have whatever folder structure you wish. But you will need to update your _Imports

Unable to determine the desired template from the input template name: blazorserverside

蓝咒 提交于 2019-12-22 06:24:31
问题 I am trying to setup blazor server side but I keep getting this problem when trying to install it following this tutorial from microsoft and I get this error in powershell window PS D:\blazorTesting> dotnet new blazorserverside -o WebApplicationServerSide Usage: new [options] Options: -h, --help Displays help for this command. -l, --list Lists templates containing the specified name. If no name is specified, lists all templates. -n, --name The name for the output being created. If no name is

Unable to determine the desired template from the input template name: blazorserverside

那年仲夏 提交于 2019-12-22 06:22:14
问题 I am trying to setup blazor server side but I keep getting this problem when trying to install it following this tutorial from microsoft and I get this error in powershell window PS D:\blazorTesting> dotnet new blazorserverside -o WebApplicationServerSide Usage: new [options] Options: -h, --help Displays help for this command. -l, --list Lists templates containing the specified name. If no name is specified, lists all templates. -n, --name The name for the output being created. If no name is