Relative Content

Tag Archive for blazorblazor-webassembly

Using WASM can I download the assemblies files before start the app in a html+js plain page used for login?

My intention is the following: I would like to have inside wwwroot a login page with very basic UI (just two texboxes and a button) with plain html + js + css. As soon as this page is loaded (document.onloadI guess) it starts asynchronously the downloading of the assemblies. When the user click the button to login it commit an ajax call to a API for authentication (json web token returns in response if credentials are valid). If the wasm files are already downloaded, the Blazor WASM appears. If the files are not yet downloaded, it wait until are downloaded and the Blazor WASM appears.

Can I have a NavLink with a relative URL

I have a WebAssembly Blazor app and I want the URLs in my menu to be relative to the current path.
If I navigate to /demo/ and I click on a link with an href of games, I want it to navigate to /demo/games but instead, it treats the href as being absolute and navigates to /games.

Blazor Wasm Open 302 Redirect in New Browser Tab

We have a REST API that is used by our Blazor spa application which exposes a feature to initiate an oAuth handshake against some line of business system for the purpose of obtaining an access token and ultimately accessing data. Some of these third party systems, can at times, have somewhat of a non-standard oAuth implementation and require additional headers or query parameters. As such the API builds the 302 response which we send back to the Blazor client. Forgive my ignore here as I am not a front-end developer but is it possible within Blazor to capture the 302 response and pop this open into a new browser tab? Upon searching for an answer it seems there’s a way to JS Interop to pop a tab and navigate to a URL but this isn’t what I want. I want the API to return a 302, with say 4 additional headers, and pass that response to the new browser tab?