Questions tagged [blazor-jsruntime]
6 questions
0
votes
1 answer
How to test if JSRuntime method ran in Blazor using bUnit?
I have this method and I want to write a bUnit test to check whether the InvokeVoidAysnc() got called.
I have the button click for the Onclick event and I have it so that the if statement is true:
// Assert
var cancelButton =…

Ayushi Amin
- 11
- 3
0
votes
0 answers
How to paste an image in the clipborad into a Blazor server-side application (C# & .NET 7.0)
I need help with a problem I'm having in a Blazor server-side app.
Specifically, I'm trying to obtain an image from the clipboard and use it as a MemoryStream.
I've looked around and even asked ChatGPT for help, but I'm not having any luck.
My…
0
votes
0 answers
Why I can't get local storage value?
I have strange situation. I create service which work with local stroge and use js file for this. I want to use getAsync fucntion.
localStorage.js
function get(key) {
console.log('getItem')
return…

Roman Nichi
- 47
- 5
0
votes
0 answers
Blazor blazor.server.js error on initial load
I am getting strange error in the browser console seemingly caused by some JS associated with default JS files that Blazor framework ships. I can;t seem to be able to figure out what this might be related to. All application components seem to be…

Yan D
- 136
- 2
- 11
0
votes
1 answer
IJSRuntime issue on calling actions
I get an error of
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Could not find
'encryptMessage' ('encryptMessage' was undefined).
Error: Could not find 'encryptMessage'…

Ibanez1408
- 4,550
- 10
- 59
- 110
0
votes
0 answers
Blazor, import module, call a function for every page with the same layout
I have a js library provided by a 3rd party. I want to import the module, and call a function, for any page that uses a common layout.
To do this, in my layout, my code looks like this:
@code {
@inject IJSRuntime _js
private…

Jeremy
- 44,950
- 68
- 206
- 332