[CLOSED] ItemTpl for Razor

  1. #1

    [CLOSED] ItemTpl for Razor

    Hi,

    We have the following code to port from aspx to razor.
    <ListConfig>
                                                                    <ItemTpl ID="ItemTpl1" runat="server">
                                                                        <Html>
                                                                            <div class="icon-combo-item {iconCls}">
                                                                                {displayName}
                                                                            </div>
                                                                        </Html>
                                                                    </ItemTpl>
                                                                </ListConfig>
    It seems like we should use XTemplate() to replace ItemTpl.
    But we still can not figure the exactly syntax between Html.X().ListConfig and Html.X().XTemplate.

    Please advise,
    Last edited by Daniil; Dec 07, 2012 at 6:41 AM. Reason: [CLOSED]
  2. #2
    Hi @gets_gui,

    Here is an example.

    Example
    <!DOCTYPE html>
    
    <html>
    <head>
        <title>Ext.Net.MVC v2 Example</title>    
    </head>
    <body>
        @Html.X().ResourceManager()
    
        @(Html.X().ComboBox()
            .ID("ComboBox1")
            .Items("Item 1", "Item 2")
            .ListConfig(Html.X().BoundList()
                .ItemTpl(Html.X().XTemplate()
                    .Html("{[xindex]}: {field1}")
                )
            )
        )
    </body>
    </html>

Similar Threads

  1. [CLOSED] [RAZOR] DraggablePanelConfig doesn't have StartDrag in Razor
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 28, 2012, 2:37 PM
  2. [CLOSED] V2.1 Combobox ItemTpl
    By Aurelio in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 01, 2012, 4:36 AM
  3. [CLOSED] [Razor] HyperLink Text in Razor
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 20, 2012, 12:16 PM
  4. [CLOSED] [Razor] Add GridView to GridPanel in razor
    By boris in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: May 09, 2012, 4:23 PM
  5. [CLOSED] [Razor] Setup Auto load panel in razor
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 27, 2012, 10:54 AM

Tags for this Thread

Posting Permissions