[CLOSED] Is there any way to render controls without using .aspx or .ascx loading?

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Is there any way to render controls without using .aspx or .ascx loading?

    Last edited by Daniil; Jan 22, 2014 at 2:40 AM. Reason: [CLOSED]
  2. #2
    Hi @jamesand,

    Please investigate these examples:
    https://examples2.ext.net/#/search/template+widget

    Probably, it is what you are looking for.
  3. #3
    Dynamic rendering could be an option for you too:

    https://examples2.ext.net/#/search/xrender
    Geoffrey McGill
    Founder
  4. #4
    Thank you Daniil and Geoffrey, but that's not the idea. I already checked those possibilities, but both use user controls, which we want to avoid here.

    We have a Portlet, and we want to render the GridPanel when we press one button, but without using user controls. Is it possible?
  5. #5
    Both the approaches that we demonstrated don't require a user control to be used.

    There is no user control in this example:
    https://examples2.ext.net/#/Miscella...dget/Overview/

    And no user control here as well:
    https://examples2.ext.net/#/XRender/Basic/New_Window/
  6. #6
    Quote Originally Posted by Daniil View Post
    Both the approaches that we demonstrated don't require a user control to be used.

    There is no user control in this example:
    https://examples2.ext.net/#/Miscella...dget/Overview/

    And no user control here as well:
    https://examples2.ext.net/#/XRender/Basic/New_Window/
    Yes I know, but those examples creates controls dinamically, and that's not our way in this case.

    In my first example, the question would have been: "Is there any way to render controls without using .aspx or .ascx loading and without creating controls dinamically?"

    It may be a non-sense question, because if the code is there, it has to be rendered.

    Thank you and I assume it is not possible.

    Regards,
  7. #7
    Quote Originally Posted by jamesand View Post
    Yes I know, but those examples creates controls dinamically, and that's not our way in this case.
    Probably, there is some misunderstanding between us.

    Again, this example:
    https://examples2.ext.net/#/Miscella...dget/Overview/

    Please clarify what do you mean by "those examples create controls dynamically" according to the example above? Do you mean this call?
    App.getMessageWindow().show();
  8. #8
  9. #9
    Well, the TemplateWidget property is defined in the BaseControl class, the base class for all the components which can be rendered to the page.

    So, it can be used for a GridPanel as well. The only restriction - you cannot put it to an Items collection.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "test", "test" },
                    new object[] { "test", "test" },
                    new object[] { "test", "test" }
                };
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Button runat="server" Text="Render GridPanel" Handler="App.Panel1.add(App.getGridPanel1());" />
    
            <ext:GridPanel ID="GridPanel1" runat="server" TemplateWidget="true">
                <Store>
                    <ext:Store runat="server">
                        <Model>
                            <ext:Model runat="server">
                                <Fields>
                                    <ext:ModelField Name="test1" />
                                    <ext:ModelField Name="test2" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column runat="server" Text="Test 1" DataIndex="test1" />
                        <ext:Column runat="server" Text="Test 2" DataIndex="test2" />
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>
    
            <ext:Panel 
                ID="Panel1" 
                runat="server"
                Title="GridPanel Holder"
                Width="400"
                Height="400"
                Layout="FitLayout" />
        </form>
    </body>
    </html>
  10. #10
    Quote Originally Posted by Daniil View Post
    Well, the TemplateWidget property is defined in the BaseControl class, the base class for all the components which can be rendered to the page.

    So, it can be used for a GridPanel as well. The only restriction - you cannot put it to an Items collection.
    Hi Daniil, that doesn't suit our needs ;)

    Thank you anyway for your help again.
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] How to passing DateFields from ascx to aspx file
    By Zenalyse in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 04, 2013, 2:12 PM
  2. Replies: 0
    Last Post: Jan 11, 2013, 1:57 AM
  3. Replies: 2
    Last Post: Nov 15, 2012, 12:52 AM
  4. Replies: 7
    Last Post: Jul 31, 2012, 8:31 PM
  5. Replies: 2
    Last Post: Apr 10, 2012, 12:08 PM

Tags for this Thread

Posting Permissions