The control with ID 'PagingTest1_Store2' not found

  1. #1

    The control with ID 'PagingTest1_Store2' not found

    Hello,

    i searched the forum for a similar problem but could not find something what fits, so might
    someone can point me in the right direction.

    I create a new Windows with a Control like this:

            protected void btnPagingTest1_Click(object sender, DirectEventArgs e)
            {
                Window win = new Window
                {
                    ID = "windowPagingTest1",
                    Title = "Paging Test 1",
                    Height = 600,
                    Width = 800,
                    Padding = 5
                };
                baseUserControl userControlPaging = (baseUserControl)LoadControl("~/Views/PagingTest1.ascx");
                userControlPaging.ID = "PagingTest1";
                win.ContentContainer.Controls.Add(userControlPaging);
                win.Render();
            }

    The Control looks like this:

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PagingTest1.ascx.cs"
        Inherits="Web.Views.PagingTest1" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <ext:Store ID="Store2" runat="server" OnRefreshData="Store2_RefreshData">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="Id">
                <Fields>
                    <ext:RecordField Name="Id" Type="String" />
                    <ext:RecordField Name="Firstname" Type="String" />
                    <ext:RecordField Name="Lastname" Type="String" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw" />
            <ext:Parameter Name="limit" Value="100" Mode="Raw" />
            <ext:Parameter Name="sort" Value="" />
            <ext:Parameter Name="dir" Value="" />
        </BaseParams>
    </ext:Store>
    <ext:GridPanel ID="GridPanel2" runat="server" Border="false">
        <ColumnModel ID="ColumnModel2" runat="server">
            <Columns>
                <ext:Column Header="Id" DataIndex="Id" />
                <ext:Column Header="First name" DataIndex="Firstname" />
                <ext:Column Header="Last name" DataIndex="Lastname" />
            </Columns>
        </ColumnModel>
        <LoadMask ShowMask="true" />
        <BottomBar>
            <ext:PagingToolbar ID="PagingToolbar2" runat="server" PageSize="100" />
        </BottomBar>
    </ext:GridPanel>
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Ext.Net;
    
    namespace Web.Views
    {
        public partial class PagingTest1 : baseUserControl
        {
            protected void Page_Load(object sender, EventArgs e)
            {
            }
            protected void Store2_RefreshData(object sender, StoreRefreshDataEventArgs e)
            {           
            }      
        }
    }
    As long the <Proxy><ext:PageProxy /></Proxy> in the Store exists, I always get the error

    [HttpException (0x80004005): The control with ID 'PagingTest1_Store2' not found]
    Ext.Net.ResourceManager.RaisePostBackEvent(String eventArgument) +1629
    Ext.Net.ResourceManager.Page_AjaxLoadComplete(Obje ct sender, EventArgs e) +259
    System.EventHandler.Invoke(Object sender, EventArgs e) +0
    System.Web.UI.Page.OnLoadComplete(EventArgs e) +8701398
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +735
  2. #2
    Hi,

    You have to recreate window control on each request
  3. #3
    Quote Originally Posted by Vladimir View Post
    Hi,

    You have to recreate window control on each request
    I'm facing similar problem. I'm creating Ext.window dynamically and also loading an ASP user control inside this window.
    Now, when I have loaded this window and I click on a Ext.button that is defined in the user control, Im getting an error the ext.button control with the control id is not found.


    My code snippet to dynamically create a window and add to a Panel

    Dim newWindow = New Ext.Net.Window()
    newWindow.ID = "ClientViewSearchID"
    newWindow.Icon = Icon.Hourglass
    newWindow.Title = "Client View Search"
    newWindow.X = 100
    newWindow.Y = 100
    newWindow.Height = 400
    newWindow.Width = 300
    newWindow.Constrain = True
    newWindow.Hidden = False

    'Add user control to window content
    Dim uc1 As UserControl
    uc1 = CType(LoadControl(FilePath.ClientViewSearch), ClientViewSearch)
    uc1.ID = "UCClientViewSearch"
    newWindow.ContentControls.Add(uc1)

    'add window to panel.
    ContentPanel.Items.Add(newWindow)

    newWindow.Show()
    newWindow.Render()
    newWindow.UpdateContent()
    -----------------------------------------------------------------------------------------------
    My code snippet for User control

    <br />
    &nbsp;&nbsp;&nbsp;&nbsp;<ext:Button id="buttonForView" runat="server" Text="View Client" OnDirectClick="buttonForView_click" >
    </ext:Button>

    </p>
    <br />
    <ext:Button id="btnCancelSearchId" runat="server" Text="Cancel" OnDirectClick="btnCancelSearch">
    </ext:Button>
    <br />

    -----------------------------------------------------------------------------------------------

    Snippet for Code Behind of my user control.

    Protected Sub buttonForView_click(ByVal sender As Object, ByVal e As DirectEventArgs)

    'ViewClientWindow.Show()
    Dim win As Window = Parent.FindControl("Window2")
    win.Show()
    End Sub

    Protected Sub btnCancelSearch(ByVal sender As Object, ByVal e As DirectEventArgs)
    Dim win As Window = Parent.FindControl("Window4")
    win.Hide()
    End Sub

    ----------------------------------------------------------------------------------------------------------------

Similar Threads

  1. [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
  2. UpdateProxy not found?
    By tuananhdnx in forum 2.x Help
    Replies: 10
    Last Post: Apr 12, 2012, 7: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: 4
    Last Post: Feb 16, 2012, 6:06 PM
  5. Replies: 1
    Last Post: Mar 14, 2008, 11:47 PM

Posting Permissions