Wow!!! am eternally grateful for this. it just help me solved my biggest problem with the prerendering and the oninitialized method. Kudos
@jsiahaan Жыл бұрын
Thank you very much. Very useful video
@MoogieWarren4 ай бұрын
Great video Abhay! One question: I don't believe we still need the subscription and the dispose method on the Weather.razsor file. Do you agree?
@MoogieWarren4 ай бұрын
And another question.... I am observing no flicker/"loading..." between the prerender and the WASM data retrieval when I hit the page the first time (context: this is a file in the *.client project) (which is awesome, you are the man). However, I do see flicker/"loading..." when I move from the page in question and go to another, then go back to the original (the one implementing BasePage, not all pages are implementing BasePage). Do you know why this is and what can be done to avoid it? P.S. I pulled down this example project, and it demonstrates the same behavior. Much Thanks!
@QVictahQ5 ай бұрын
Thank you! Is this applicable to Blazor server app?
@abhayprince5 ай бұрын
Yes
@gabrielhvd5 ай бұрын
Could this apply for WebAssembly model? I'm facing a issue where my WebAssembly Blazor App is calling the OnInitizalizeAsync mehotd several times and I don't know why. Thanks for the video!
@abhayprince5 ай бұрын
Yes, only if Pre-rendering is enabled
@hashimal-mansouri9163 Жыл бұрын
THX
@Buckanian10 ай бұрын
is this applicable to the blazor SSR template
@abhayprince10 ай бұрын
SSR is statically server side rendered, so this problem does not exists there. This video is about Interactive Modes which first prerenders the content on server and then renders again on client
@manojnaik56438 ай бұрын
Nice Explanation, can you please guide how to apply this logic to call basepage class in webassembly client pages, I am new in blazor. getting error "The registered callback b__0 must be associated with a component or define an explicit render mode type during registration." I am using client and server webapp interactive mode.
@wherryd6 ай бұрын
To solve this, you just need to explicitly set the render mode for your RegisterOnPersisting method: _subscriptions.Add(ApplicationState.RegisterOnPersisting(() => { ApplicationState.PersistAsJson(key, data); return Task.CompletedTask; }, RenderMode.InteractiveAuto));
@eduardogoncalvesdossantos43235 ай бұрын
@@wherryd , PROBLEM SOLVED!!!! THANKS!!!!
@andymesta49132 ай бұрын
When you change the page and come back it no longer works
@anushakondra7778 Жыл бұрын
how to solve this issue(onintialised method calling twice) in .net 7. Rendermode is available only for .Net 8 version as in your case.
@abhayprince Жыл бұрын
You can use the second approach I showed. using PersistComponentState
@anushakondra7778 Жыл бұрын
does persistComponentState work without injecting rendermode[InteractiveServer] ?? i have tried second method, but the api call was made twice.
@MiguelÁngelCardonaVillagomezАй бұрын
This is NOT working, when navigating to another Page and going back to Weather, the OnInitializedAsync() executes 3 times! First 2 it goes through the await Task.Delay(500); and third time it actually skips it. Can you please explain? I downloaded your code sample. If you delay to 5000 this will be more notorious.
@abhayprinceАй бұрын
@@MiguelÁngelCardonaVillagomez Interesting. I will check and update here
@goditto56948 ай бұрын
Thank you fo rthis video. But Aren't the descriptions mutually contradictory? Of course, I understand that the Interactive mode of a WebApp obviously renders twice, once on the server side and once on the client side, From the way you describe it, When the server finishes rendering, the client get fetches the all that data from the server. In your example, the rendered data didn't actually exist on the client's source with InteractiveServerMode. So how is it possible to explain that the client renders the same OnInitializedAsync() logic again? They seem to contradict each other.
@krugovi10 ай бұрын
Hi. Great video, but I have one problem. The first time everything works ok, but after changing the page, and returning back, the delegate method that was sent to "GetOrAddState" is executed, but the screen is not updated, and it keeps saying "Loading..."
@abhayprince10 ай бұрын
Strange. I need to check it. For now you can try calling StateHasChanged() method
@krugovi10 ай бұрын
in debug mode, error : "System.InvalidOperationException: The registered callback b__0 must be associated with a component or define an explicit render mode type during registration." (VS : 17.8.5, last update : 19.01.2024.)
@sebastianolaf9 ай бұрын
Hi I try to implement this and got this error below, need your help InvalidOperationException: The registered callback b__0 must be associated with a component or define an explicit render mode type during registration.