More in this section

Forums / Developing with Sitefinity / error in editing master page.

error in editing master page.

2 posts, 0 answered
  1. Zeeshan fawad
    Zeeshan fawad avatar
    4 posts
    05 Jun 2009
    08 Oct 2009
    Link to this post
    I'm doing the porting from exsisting website where in a masterpage is used relative paths for SSL and Non SSL pages and eg

    for  links of NonSSL page

    a href='<%= root & "Default.aspx" %>'> and
    for links of SSL page



    ='<%= roots & "personalized/download.aspx" %>'


    for css

    link rel="stylesheet" href="<%=rootimg & "newstyles.css"%>" type="text/css" >



    and for images



    img src='<%= rootimg & "images/top-bar1a.gif"%>'
    So when this master page is converted to sitefinity masterpage , it give me the following  error when a child pages is associated with it.
    The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
    Please guide me how to handle it.
    Zeeshan Fawad


  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    09 Oct 2009
    Link to this post
    Hi Zeeshan fawad,

    You could try using js in the body of the master page to add links.


    <%@ Master Language="C#" %>
    <%@ Register TagPrefix="ss" Assembly="Telerik.Search" Namespace="Telerik.Search.WebControls"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <script runat="server">
        protected string root = "";
    <head runat="server">
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />    
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            <div id="wrapper">
            <div id="Header">
                <h1>My Organization</h1>
                <div id="TopNavigation">
                    <asp:contentplaceholder id="TopMenu" runat="server"></asp:contentplaceholder>           
            <div id="Main"><asp:contentplaceholder id="Content" runat="server"></asp:contentplaceholder></div>
            <div id="SideBar"><asp:contentplaceholder id="SideBarContent" runat="server"></asp:contentplaceholder></div>   
            <div id="Footer">2006-2007 © MyOrganization. All rights reserved </div>
    <script type="text/javascript">
        document.getElementById('mylink').href = '<%= root & "Default.aspx" %>';

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered