The control with ID 'ctl04_AddDoc' not found

  1. #1

    The control with ID 'ctl04_AddDoc' not found

    HI,
    I try to build a page with a ribbon style menu. So in the Ribbon I have buttons. The page is displayed and when I press the button I get the below error 500 message.

    I am not sure, what I do wrong to get the Click event triggered in the ASCX code behind.

    Anyone able to help with a hin?


    Server Error in '/' Application.


    The control with ID 'ctl04_AddDoc' not found

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: The control with ID 'ctl04_AddDoc' not found

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [HttpException (0x80004005): The control with ID 'ctl04_AddDoc' not found] Ext.Net.ResourceManager.RaisePostBackEvent(String eventArgument) +1081 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +176 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

    ----------------------------------------------------
    The content in the ASCX page looks like this. In the last line is the onDirectClick handler

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="T2.ascx.cs" Inherits="TestExt2.Desktop.T2" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <ext:TabPanel ID="TabPanel1" runat="server">
        <Items>
            <ext:Panel ID="Tab1" runat="server" Title="<%$resources: Menue_Product %>" AutoHeight="true"
                BodyPadding="6">
                <Content>
                   
                </Content>
            </ext:Panel>
            <ext:Panel ID="Tab2" runat="server" Title="Language" AutoHeight="true">
                <Items>
                    <ext:Panel ID="Panel1" runat="server" Title="">
                        <TopBar>
                            <ext:Toolbar ID="Toolbar1" runat="server">
                                <Items>
                                    <ext:ButtonGroup ID="ButtonGroup1" runat="server" Title="Clipboard" Columns="3">
                                        <Items>
                                            <ext:Button ID="AddDoc" runat="server" Text="<%$Resources: AddDoc %>" IconCls="add32"
                                                Scale="Large" IconAlign="Top" Cls="x-btn-as-arrow" RowSpan="2" OnDirectClick="Click">
    ----------------------------------------------------
    The Codebehind looks like this:


    namespace TestExt2.Desktop
    {
        public partial class T2 : System.Web.UI.UserControl
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
    
            }
    
    
    
    
            protected void Click(object sender, DirectEventArgs e)
            {
                int a = 2;
            }
    }
    Last edited by geraldf; Aug 23, 2012 at 4:36 PM.
  2. #2
    One thing to add.
    While I was havvng the error, I was adding the UserControl (ASCX) via code to the aspx page.
    using this code
     T2 a = (T2)Page.LoadControl("Desktop/T2.ascx");
     Panel1.ContentControls.Add(a);
    Now I changed it and added the UserControl directly in the ASPX page, and the problem was gone.
    <ext:Panel ID="Panel1" runat="server" Height="300"  Title=""  >
            <Content>
                  <t2:TEST ID="UserControl2"  runat="server" />
            </Content>

Similar Threads

  1. Replies: 7
    Last Post: Aug 23, 2012, 6:55 AM
  2. [CLOSED] The control with ID 'ext-empty-store' not found
    By supera in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 31, 2012, 12:16 PM
  3. [CLOSED] Error: The control with ID 'cmbMenu' not found
    By Sevilay Tanış in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 13, 2012, 9:44 AM
  4. Replies: 2
    Last Post: Nov 02, 2011, 7:07 AM
  5. Replies: 1
    Last Post: Mar 14, 2008, 11:47 PM

Posting Permissions