Hello guys,
I'm having trouble updating textbox "A" thats inside a repeater from a button which gets some textbox "B" from is inside the repeater aswell.
First of all, the content of the textbox "A" is binded with DataBinder.Eval and I'm getting an error "The Controls collection cannot be modified because the control contains code blocks (i.e. <% … %>) " and I found a solution online by wraping the repeater with <telerik:RadCodeBlock runat="server">, is this the correct way of fixing it?
Here is my ajaxManager:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="listaDeElementos">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="listaDeElementos" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
After I click the button, changes are actually made in the database but the repeater does not refresh. Nothing happens and I have to reload the page to actually see the changes. Here is my repeater:
<telerik:RadCodeBlock runat="server" ID="radcode1">
<asp:Repeater ID="listaDeElementos" runat="server" OnItemCommand="listaDeElementos_ItemCommand" >
<ItemTemplate>
<asp:TextBox runat="server" ID="txtMostrarComentario" Text='<%# string.Format("{0}", DataBinder.Eval(Container.DataItem, "Comentario")) %>' enabled="false" TextMode="MultiLine" Width="65%" style="margin-top:10px;resize:none"></asp:TextBox>
<asp:TextBox runat="server" ID="txtComentario" Text="" placeholder="Añadir comentario" TextMode="MultiLine" Width="33%" style="margin-top:10px;resize:none"></asp:TextBox>
<asp:Button ID="btnGuardarComentarioYnumeroDeSerie" runat="server" CommandArgument='<%# Eval("Id") %>' CommandName="GuardarComentarioYnumerodeserie" Text="Guardar" Width="100%" CausesValidation="False" />
<br />
<hr />
</ItemTemplate>
</asp:Repeater>
</telerik:RadCodeBlock>
So how do I make it update?
Thanks.