PageState is null in Theme Control #4684
Replies: 2 comments 3 replies
-
@vnetonline this topic has been covered many times previously. When using Blazor and crossing render mode boundaries from static to interactive, the state which is held by cascading parameters and scoped services is not automatically passed and will be null. This was one of the biggest challenges we had to overcome in Oqtane 5.1 in order to support static rendering. Your theme component is static but you are trying to render your AmsCart component interactively. This means you are crossing a render mode boundary. PageState is a cascading parameter so it will be null when it is referenced in the interactive component. You can either make your AmsCart component static - which will provide access to PageState (as you would not be crossing a render mode boundary) or you can use the technique I documented here: https://www.oqtane.org/blog/!/91/passing-state-to-components-using-ssr-in-net-8 which is how Oqtane passes state to interactive module components |
Beta Was this translation helpful? Give feedback.
-
@sbwalker I have converted my cart to static render, but I am still having issues with updating number of items in CartCount because the In my Payment Module I am using ExpandoObject like below to set the Cart Count I call this mehod from a Method 'BuyCourse`.
In my Theme I have a Cart Control as follows
Can you please provide me with some guidance? |
Beta Was this translation helpful? Give feedback.
-
I have a very simple control which I have made in a Theme
NavigateUrl()
uses PageState but the PageState is always nulli am using the above in my
Default.razor
can you please help me with why this is?
I am using the latest Dev branch
Beta Was this translation helpful? Give feedback.
All reactions