A razor component binds its OnInput event to a JavaScript function. How can I read the razor component property from within the JavaScript function?
You can add a method in your Razor component with the [JSInvokable] attribute. In this method you can return the properties that you need in your Javascript.
[JSInvokable]
public static Task<int[]> ReturnArrayAsync()
{
return Task.FromResult(this.MyProperty);
}
And in javascript side:
DotNet.invokeMethodAsync('{ASSEMBLY NAME}', 'ReturnArrayAsync', {ARGUMENTS}); //in that case we do not need arguments
It should do the trick. Good luck :)