Master.FindControl returns null on everything when wrapped with ContentPlaceHolderDefault
First time umbraco dev here.
i'm trying to set a class on my body element thats found on the first master page.
How i have it set up right now is
page.master -> landing.master -> content.master
based on what the content type is, the body's class attribute has to be changed.
so i'v made a recursive method to find the correct master page for me(in this case, page.master) and change the class for the body element. everything works fine.
Not sure if this helps but most of the time i add a class to my body tag dependant on what the DocuemntType is (i normally add the actual DocumentType name to the body's class attribute) ... and i use a simple XSLT to provide the data
To be honest havent really used Canvas editing, and i activly try to discourage usage of it ... If you really need to work this out, i would suggest getting the Umbraco source code and debugging through the entire thing
Master.FindControl returns null on everything when wrapped with ContentPlaceHolderDefault
First time umbraco dev here.
i'm trying to set a class on my body element thats found on the first master page.
How i have it set up right now is
page.master -> landing.master -> content.master
based on what the content type is, the body's class attribute has to be changed.
so i'v made a recursive method to find the correct master page for me(in this case, page.master) and change the class for the body element. everything works fine.
and then i wrap it with
asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server"
in the @master directive, i have MasterPageFile="~/umbraco/masterpages/default.master"
then the FindControl method returns null on everything.
i cannot for the life of me figure out whats wrong.
another side effect of the wrap is that i lose all my intellisense for the asp and umbraco namespace.
anyone?
Not sure if this helps but most of the time i add a class to my body tag dependant on what the DocuemntType is (i normally add the actual DocumentType name to the body's class attribute) ... and i use a simple XSLT to provide the data
and then the XSLT is simply ... you can off course add extar logic here if need be
Thanks for that Asif.
I think the bigger problem here is that the FindControl() method suddenly returns null on everything when i wrap the base master page with the
"asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" to allow canvas editing to work.
To be honest havent really used Canvas editing, and i activly try to discourage usage of it ... If you really need to work this out, i would suggest getting the Umbraco source code and debugging through the entire thing
is working on a reply...