PDA

View Full Version : [CLOSED] Reload asp:Repeater from DirectMethod



luiz
Sep 16, 2013, 2:57 PM
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.UsuarioLogad o.Id);
RepeaterCampeonato.DataSource = eventos;
RepeaterCampeonato.DataBind();
...
RepeaterCampeonato.Update(); //optional test

}
}
catch (RegraVioladaException ex)
{
...
}
catch (Exception ex)
{
...
}
}

The repeater not update...

Any suggestion?

geoffrey.mcgill
Sep 16, 2013, 11:05 PM
Instead of .Update(), try .Render().

Hope this helps.

luiz
Sep 17, 2013, 2:48 PM
Hi Geoffrey,

The asp.net Repeater do not contain Render method.

Thanks!

Vladimir
Sep 17, 2013, 3:06 PM
I suugest to wrap the repeater by Ext.Net.Container and call UpdateContent for the container

luiz
Sep 27, 2013, 9:59 PM
Hi Vladimir,

Works fine.

Thanks for you help.