[CLOSED] Issue using UserControlLoader

  1. #1

    [CLOSED] Issue using UserControlLoader

    Hi,
    When I use usercontrolloader inside a page, it works fine. But when I use it inside a control to add another control, I get following error :

    Unable to cast object of type 'Ext.Net.UserControlLoader' to type 'Ext.Net.AbstractContainer'

    Can you help?

    Thanks,
    Last edited by geoffrey.mcgill; Sep 12, 2012 at 8:50 PM. Reason: [CLOSED]
  2. #2
    But when I use it inside a control to add another control, I get following error :
    Can you demonstrate it? I am not sure that clear understood the scenario
  3. #3
    Resolved.

    There was an issue with my code.

    Thanks,
  4. #4
    Hi,
    I have another issue with User Control Loader.

    When I try to call DirectMethod I get the following error :
    The ajax instance method 'FollowSavedSearch' is absent!

  5. #5
    Please provide test sample
  6. #6
    I am trying to reproduce it.
  7. #7
    The issue occured because I had ID and UserConrolID both having same ID in ext:usercontrolloader. Having both unique resolved the issue. May be it could throw compilation error or a more relevant error.
  8. #8
    Hi @amitpareek,

    Please clarify do you mean something like this?

    Example
    <ext:UserControlLoader 
        ID="SomeID" 
        runat="server" 
        UserControlID="SomeID" 
        Path="TestUC.ascx" />
  9. #9
    Yes. If you have both id's same, it cant find the method, because it tries to search for the method in UserControlLoader class instance.

    Try having DirectMethod in TestUC.ascx and try to access it, you will know what I am talking abt.
  10. #10
    Ok, here is my sample. I am getting this Exception.
    Multiple controls with the same ID 'SomeID' were found.
    FindControl requires that controls have unique IDs.
    Please provide your test case.

    Example Page
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:UserControlLoader 
                ID="SomeID" 
                runat="server" 
                UserControlID="SomeID" 
                Path="TestUC.ascx" />
        </form>
    </body>
    </html>
    Example User Control
    <%@ Control Language="C#" %>
    
    <script runat="server">
        [DirectMethod]
        public void TestDirectMethod()
        {
            X.Msg.Alert("DirectMethod", "Hello from User Control!").Show();
        }
    </script>
     
    <ext:Button runat="server" Text="Call DirectMethod">
        <Listeners>
            <Click Handler="#{DirectMethods}.TestDirectMethod()" />
        </Listeners>
    </ext:Button>

Similar Threads

  1. [CLOSED] UserControlLoader and Content
    By thchuong in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 11, 2012, 8:03 AM
  2. [CLOSED] Pecilluar issue in the DropDown, UI Issue
    By Shanth in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 22, 2012, 12:02 PM
  3. [CLOSED] ext.UserControlLoader in CodeBehind
    By supera in forum 2.x Legacy Premium Help
    Replies: 16
    Last Post: Feb 07, 2012, 5:14 PM

Posting Permissions