This is a migrated thread and some comments may be shown as answers.

Server Side tag in .aspx page is not working

1 Answer 17 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
umesh
Top achievements
Rank 1
umesh asked on 07 Feb 2014, 04:36 PM
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

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Feb 2014, 05:22 AM
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.
Tags
Ajax
Asked by
umesh
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or