I am creating a custom section to manage products. I am basing my pages on the umbracoPage.master, and inheriting from UmbracoEnsuredPage - all of this is working perfectly.
However, I'm having a bit of a Monday Moment trying to use my own master pages; I want to create a master page which sets up the chrome and stylesheets / scripts for the whole of this custom section, then base the pages on that.
The fly in the ointment is that part of the UI is an UmbracoPanel to display the "Welcome Username" message so the section fits in with the rest of the backend.
If I inherit my master page from UmbracoEnsuredPage to access the current user I get an error, as UmbracoEnsuredPage is based on System.Web.UI.Page, not System.Web.UI.MasterPage.
If I inherit from System.Web.UI.MasterPage I have no access to CurrentUser.
Am I missing some obvious way to achieve what I want?
Custom section / master pages
I am creating a custom section to manage products. I am basing my pages on the umbracoPage.master, and inheriting from UmbracoEnsuredPage - all of this is working perfectly.
However, I'm having a bit of a Monday Moment trying to use my own master pages; I want to create a master page which sets up the chrome and stylesheets / scripts for the whole of this custom section, then base the pages on that.
The fly in the ointment is that part of the UI is an UmbracoPanel to display the "Welcome Username" message so the section fits in with the rest of the backend.
If I inherit my master page from UmbracoEnsuredPage to access the current user I get an error, as UmbracoEnsuredPage is based on System.Web.UI.Page, not System.Web.UI.MasterPage.
If I inherit from System.Web.UI.MasterPage I have no access to CurrentUser.
Am I missing some obvious way to achieve what I want?
you can get current user from any where like this:
Perfect, thanks Daniel.
You are most welcome!
is working on a reply...