Server Side tag in .aspx page is not working

2 posts, 0 answers
  1. umesh
    umesh avatar
    3 posts
    Member since:
    Feb 2014

    Posted 07 Feb 2014 Link to this post

    In thi scode Cc is server side varibale . but it throw an error

    The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

    <body class="demoMail">
        <form id="form" runat="server">
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" EnableRoundedCorners="False"
            DecoratedControls="All" />
        <div id="tabs">
            <ul>
                <li><a href="#tabs-1">DemoMail</a></li>
                <li><a href="#tabs-3">DemoMail Sentbox</a></li>
                <% if (Cc==2)
                 {%>
                <li><a href="#tabs-2">Constant Contact Report</a></li>
                <%}%>
                  <% if (mm==3)
                 {%>
                <li><a href="#tabs-4">Marketo Report</a></li>
                  <%}%>
            </ul>
    plz post me a solution asap
    thanks
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Feb 2014 in reply to umesh Link to this post

    Hi Umesh,

    Please have a look into the following modification I did on your code which works as expected for me.

    ASPX:
    <div id="tabs">
        <ul>
            <li><a href="#tabs-1">DemoMail</a></li>
            <li><a href="#tabs-3">DemoMail Sentbox</a></li>
            <%int Cc = 2, mm = 3; %>
            <%if (Cc == 2) %>
            <%{ %>
            <li><a href="#tabs-2">Constant Contact Report</a></li>
            <%    } %>
            <%if (mm == 3) %>
            <%{ %>
            <li><a href="#tabs-4">Marketo Report</a></li>
            <%} %>
        </ul>
    </div>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top