Mar 17, 2014, 3:26 PM
[CLOSED] The control with ID 'MainContent_ctl69' not found
I got the error message when I added MasterPageFile in the aspx file.
here is my code:
aspx
but it was work when I didn't use MasterPageFile, please help, thanks a lot.
here is my code:
aspx
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent" >
.................
<ext:Portlet ID="PortletGroupView" runat="server" Layout="TableLayout" Closable="false" Draggable="false" Frame="false" Collapsible="false" Border="false">
<LayoutConfig>
<ext:TableLayoutConfig Columns="3" />
</LayoutConfig>
<Items>
</Items>
</ext:Portlet>
........................
</asp:Content>
C# Code public class GROUP_HOST
{
public String GROUP_NAME { get; set; }
public String DURATION { get; set; }
public String COUNT_OK { get; set; }
public String COUNT_WARNING { get; set; }
public String COUNT_NG { get; set; }
}
public partial class Default : System.Web.UI.Page
{
protected void Load_Group_View()
{
List<GROUP_HOST> ghlst = new List<GROUP_HOST>();
for (int i = 1; i < 10; i++)
{
GROUP_HOST gh = new GROUP_HOST();
gh.GROUP_NAME = "Group_" + i;
gh.DURATION = i * 2 + "D" + 1 * i + "H" + 2 * i + "m";
gh.COUNT_NG = 2 * i + "";
gh.COUNT_OK = 3 * i + "";
gh.COUNT_WARNING = 1 * i + "";
ghlst.Add(gh);
}
foreach (GROUP_HOST gh in ghlst)
{
Ext.Net.Button btnOK = new Ext.Net.Button
{
Scale = ButtonScale.Large,
Width = 50,
Cls = "btn-green",
Text = "<span style='color:while;'>"+gh.COUNT_OK+"</span>",
AutoDataBind = true
};
Ext.Net.Button btnWarning = new Ext.Net.Button
{
Scale = ButtonScale.Large,
Width = 50,
Cls = "btn-yellow",
Text = "<span style='color:while;'>" + gh.COUNT_WARNING + "</span>",
AutoDataBind = true
};
Ext.Net.Button btnNG = new Ext.Net.Button
{
Scale = ButtonScale.Large,
Width = 50,
Cls = "btn-red",
Text = "<span style='color:while;'>" + gh.COUNT_NG + "</span>",
AutoDataBind = true
};
btnOK.DirectEvents.Click.Event += GroupViewClick;
btnWarning.DirectEvents.Click.Event += GroupViewClick;
btnNG.DirectEvents.Click.Event += GroupViewClick;
Ext.Net.Panel pn = new Ext.Net.Panel
{
Title = gh.GROUP_NAME,
FrameHeader = true,
BodyPadding = 10,
Frame = true,
Width = 200,
Items = {
new Ext.Net.Label{
Text = gh.DURATION,
Height = 100,
Width=100
},
new Container{
Items = {
btnOK,btnWarning,btnNG
}
}
}
};
this.PortletGroupView.Items.Add(pn);
}
}
protected void GroupViewClick(object sender, EventArgs e)
{
String aaa = ((Ext.Net.Button)sender).Text;
}
}
When I trigger the button click event, will get error "The control with ID 'MainContent_ctl69' not found".but it was work when I didn't use MasterPageFile, please help, thanks a lot.
Last edited by Daniil; Mar 18, 2014 at 12:48 PM.
Reason: [CLOSED]