[CLOSED] Reload asp:Repeater from DirectMethod

  1. #1

    [CLOSED] Reload asp:Repeater from DirectMethod

    Hi, is possible update asp:Repeater control from DirectMethods call?


    My code:

    HTML
    <ext:Container ID="ContainerScript" runat="server" IDMode="Explicit" IsDynamic="False" Namespace="App">
            <Content>
                <script type="text/jscript">               
                    function ParticiparEvento_Clique(idEvento) {
                        try {
                            App.direct.ParticiparEvento_Clique(idEvento);
                        } catch (e) {
                            ShowMessageBoxError(e);
                        }
                    }
                </script>
            </Content>
        </ext:Container>
    
    
    <div class="xxxxxx">
            <asp:Repeater ID="RepeaterCampeonato" runat="server">
                <HeaderTemplate>
                    <div class="">
                </HeaderTemplate>
                <ItemTemplate>              
                    <div class="">                   
                        <div class="">
                            <div class="">ANO</div>
                            <div class=""><%# DataBinder.Eval(Container.DataItem, "DataInicio", "{0:yy}") %></div>
                        </div>                   
                        <div class="">
                            <div class="">                          
                                <div class="">
                                    <img src="../Resources/images/btn_participar_icon.png" alt="" width="45" height="43" class="tab_btn_img" />
                                    <span class="" onclick="ParticiparEvento_Clique(<%# DataBinder.Eval(Container.DataItem, "Id") %>); return false;">Test</span>
                                </div>                           
                            </div>                    
                        </div>
                    </div>
                </ItemTemplate>
                <FooterTemplate>
                    </div>
                </FooterTemplate>
            </asp:Repeater>
    </div>
    C#

        [DirectMethod(ShowMask = true)]
            public void ParticiparEvento_Clique(int idEvento)
            {           
                try
                { 
                    using (xx = new xxx())
                    {
                        ...                    
                        List<EventoCustomizado> eventos = eventoNegocio.ObterTodosAtivos(Master.UsuarioLogado.Id);
                        RepeaterCampeonato.DataSource = eventos;
                        RepeaterCampeonato.DataBind();
                        ...                                        
                        RepeaterCampeonato.Update(); //optional test
                       
                    }
                }
                catch (RegraVioladaException ex)
                {
                   ...
                }
                catch (Exception ex)
                {
                    ...
                }
            }
    The repeater not update...

    Any suggestion?
    Last edited by Daniil; Sep 25, 2013 at 5:25 AM. Reason: [CLOSED]
  2. #2
    Instead of .Update(), try .Render().

    Hope this helps.
    Geoffrey McGill
    Founder
  3. #3
    Hi Geoffrey,

    The asp.net Repeater do not contain Render method.

    Thanks!
  4. #4
    I suugest to wrap the repeater by Ext.Net.Container and call UpdateContent for the container
  5. #5
    Hi Vladimir,

    Works fine.

    Thanks for you help.

Similar Threads

  1. [CLOSED] Repeater binding from DirectEvent
    By trezv in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 12, 2013, 5:20 PM
  2. Replies: 1
    Last Post: Mar 27, 2012, 2:36 AM
  3. Repeater inside GridPanel
    By bruno in forum 1.x Help
    Replies: 1
    Last Post: Sep 15, 2011, 4:40 PM
  4. [1.0] Repeater and TabPanel
    By SouthDeveloper in forum 1.x Help
    Replies: 3
    Last Post: May 18, 2010, 4:28 PM
  5. Update asp.net Repeater with AjaxMethod
    By FreddieBoo in forum 1.x Help
    Replies: 3
    Last Post: Aug 13, 2009, 7:21 AM

Tags for this Thread

Posting Permissions