USER CONTROL PROBLEM

S

Savas Ates

Im getting error which is like that

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



string refcode;

refcode=Request.QueryString["refcode"];


if ( refcode!=null)

{ refcode=refcode.ToLower();

Session["refcode"]=refcode;

if ( (string)Session["refcode"]=="antu")

{


Control ANTUUST = LoadControl("Skin/ANTUUST.ascx");

Page.Controls.Add (ANTUUST);




}



My control includes only that code



<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="ANTUUST.ascx.cs" Inherits="xxx.Skin.ANTUUST"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<table runat="server" id="AutoNumber1" style="BORDER-COLLAPSE: collapse"
borderColor="#111111"
cellSpacing="0" cellPadding="0" width="1000" border="0">
<tr runat="server">
<td width="100%" runat="server">
<IMG id="IMG1" height="180" src="images/antu_ust.jpg" width="1000"
border="0" runat="server">
</td>
</tr>
</table>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top