In documentation for Kentico 8.2 I found article "Developing layout web parts". In step 7 is following code:
if (IsDesign) { Append("<table class=\"LayoutTable\" cellspacing=\"0\">"); if (PortalContext.IsDesignMode(this.ViewMode)) { Append("<tr><td class=\"LayoutHeader\" colspan=\"2\">"); // Adds a header container. AddHeaderContainer(); Append("</td></tr>"); } Append("<tr><td>"); }
I don't understand why we have if(PortalContext.IsDesignMode(this.ViewMode)). Didn't we just ensure that all that Append methodes will fire only in designe mode when we wrote if(IsDesign) at the begining?
Have you tried to debug that code? Does IsDesign == PortalContext.IsDesignMode(this.ViewMode) all the time?
Please, sign in to be able to submit a new answer.