Hazel Mahmud

Hazel Mahmud

  • NA
  • 299
  • 65.7k

using stringbuilder to build ContentPlaceHolder

Feb 4 2018 11:45 PM
hello.. i'm using stringbuilder to create contentPlaceholder in nestedMasterpage but i get this error. -->
 
Cannot find ContentPlaceHolder 'MainContent' in the master page '/Masterpage/leftMenuMaster.Master', verify content control's ContentPlaceHolderID attribute in the content page.
 
how do i fix this?..My codes are as below :
 
stringBuilder.Append("</td>");
stringBuilder.AppendFormat("<td>fsdfsfsdfs</td>");
stringBuilder.AppendFormat("<td style=width: 99%; background-color:white; vertical-align:top><asp:ContentPlaceHolder ID=MainContent runat=server><p>&nbsp;MainContent</p></asp:ContentPlaceHolder></td>");
stringBuilder.Append("</tr>");
stringBuilder.Append("</table>");
stringBuilder.Append("</div>");
 
TQ.

Answers (4)