I would like to be able to pass a model to my base layout _layout.cshtml exactly like in this example. The problem is that this example is only valid for the MVC framework and I use razor pages without MVC.
I saw that we could override the Page() method in a class inheriting from PageModel but I have the impression that it is not possible to provide the model at view creation time.
public class IndexModel : PageModel {
public override PageResult Page() {
return base.Page(); // how to pass a custom model?
}
}
If anyone has any ideas or another way to do it I'm a taker. Thanks :)