[CLOSED] How to render client's ID of the same way as 1.x?

  1. #1

    [CLOSED] How to render client's ID of the same way as 1.x?

    Hi,

    In the following 1.x example:

        <ext:Window ID="Window1" runat="server" Closable="false" Resizable="false" Height="130"
            Icon="Lock" Title="My Frog's Leg Starling"
            Draggable="true" Width="340" Modal="false" Border="false" Padding="0"
            Margin="0">
                <Items>
                    <ext:Panel runat="server" ID="Panel1">
                        <Items>
                            <ext:TextField runat="server" ID="TextField1" />
                        </Items>
                    </ext:Panel>
                </Items>
        </ext:Window>
    If IDMode's ResourceManager set to Explicit, Ext.NET 1.x renders any component as single component (without inherit).

    In the abobe case:
    Window1
    Panel1
    TextField1
    In Ext.NET 2.x, renders (even ResourceManager IDMode="Explicit"):
    Window1
    Window1_Panel1
    Window1_Panel1_TextField1
    There is a combination of property values ​​in the ResourceManager to do that could act the same way?

    Greetings,
    Last edited by Daniil; Jun 12, 2012 at 4:16 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please use
    IDMode="Static"
    instead of Explicit.
  3. #3
    Generally, I am unable to reproduce the issue you have described.

    To get the same as it is in Ext.NET v1, you only need to set up
    Namespace=""
    for the ResourceManager.

    Changelog item #90.
    https://examples2.ext.net/#/Getting_...nts/CHANGELOG/

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" Namespace="" />
    
        <ext:Window ID="Window1" runat="server">
            <Items>
                <ext:Panel ID="Panel1" runat="server">
                    <Items>
                        <ext:TextField ID="TextField1" runat="server" />
                    </Items>
                </ext:Panel>
            </Items>
        </ext:Window>
    
        <ext:Button runat="server" Text="Get client ids">
            <Listeners>
                <Click Handler="alert('#{Window1}' + ' ' + '#{Panel1}' + ' ' + '#{TextField1}');" />
            </Listeners>
        </ext:Button>
    </body>
    </html>
  4. #4
    Hi Daniil,

    To work exactly like Ext.NET1.x, it is necessary to define IDMode Static and Namespace to string.Empty?

    Check the alert function: it seems to work for it because is written the control's id as a text.

    Thanks,
  5. #5
    Quote Originally Posted by softmachine2011 View Post
    To work exactly like Ext.NET1.x, it is necessary to define IDMode Static and Namespace to string.Empty?
    No, just
    Namespace=""
    Quote Originally Posted by softmachine2011 View Post
    Check the alert function: it seems to work for it because is written the control's id as a text.
    It has been done in demonstration purpose. #{controlServerId} returns the client id of that server control.

    You can access the controls directly by Window1, Panel1 and TextField1 reference in my example.

Similar Threads

  1. Render dynamic store id in client different when postback
    By Nhím Hổ Báo in forum 1.x Help
    Replies: 1
    Last Post: May 03, 2012, 8:50 PM
  2. Replies: 22
    Last Post: Feb 03, 2012, 6:58 PM
  3. [CLOSED] Toggle Render? Refresh Render?
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 08, 2011, 3:13 PM
  4. [CLOSED] [1.0] Render example
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 17, 2010, 11:10 AM
  5. Replies: 0
    Last Post: Sep 17, 2009, 8:04 AM

Posting Permissions