Dynamically display razor page based on a certain condition

179 views Asked by At

I am looking to dynamically display a razor page based on some condition. Specifically, I intend to have a parent page model and have that dynamically invoke a child page model based on some condition. My current folder structure looks like this

  • Parent
    • Child a
    • Child b
    • Child c

So depending on the condition, Child a or Child b or Child c should be invoked and it's corresponding page should be displayed to the user. I thought about overriding the parent's OnPageHandlerSelectionAsync, however I'm not quite sure how that can be achieved as I'm quite new to .Net Core.

What is the most efficient way to solve this problem?

0

There are 0 answers