Will RenderMode.InteractiveServer ALWAYS call OnInitializedAsync() twice? #53452
Unanswered
DavidThielen
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all;
First, to make sure I understand
InteractiveServer
correctly, it is callingOnInitializedAsync()
twice. First to get the HTML skeleton (my word) of the page up ASAP. So the entire page, but text boxes, grids and lists are empty; combo boxes, etc. don't have their allowed choices, etc. So the full page, but no data.And the interactive controls are not (yet) wired up between the client and server. So it's a static page as well as having no data.
Then
OnInitializedAsync()
is called again and this time we want the fully populated page, with the interactive controls wired up between client and server.If so, then instead of reading in the data on the first call and caching it to supply again on the second call, wouldn't it be better to not hit the database at all on the first call? Because the goal on the first call is speed?
OnInitializedAsync()
?OnInitializedAsync()
exactly twice?And then, assuming the above is correct, there's the critical question:
And then finally, out of curiosity:
OnInitializedAsync()
and then byOnPopulatePageAsync()
?thanks - dave
Beta Was this translation helpful? Give feedback.
All reactions