Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,382 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
How to return json string into c# object from js result using Ijsruntime in blazor wasm?
After that will parse json string to json format and put into list<string>
json string is like this -
[{"value":"jggkg"},{"value":"566"},{"value":"989"},{"value":"2235"},{"value":"656"},{"value":"56"}]
server:
public class MyResponse
{
public string? value {get; set;}
}
....
await JS.InvokeAsync<MyResponse[]>("myJsFunction");
client:
const myJsFunction = () => [{"value":"jggkg"},{"value":"566"},{"value":"989"},{"value":"2235"},{"value":"656"},{"value":"56"}];
note: you could just use {value: "some value"}