'UpdatePanel, Repeater and InitializeComponent()
This is the code that works with the repeater
<asp:Repeater ID="repBugs" runat="server">
<HeaderTemplate>
<table class="DataTable" border="0" cellpadding="2" cellspacing="0" style="width: 100%">
<tr>
<td class="CellNameButton">
<asp:LinkButton ID="hlDescription" runat="server" CssClass="CasualBold" OnClick="hlDescription_Click">Short title of task</asp:LinkButton>
<asp:Image ID="imgDescription_Sort" runat="server"></asp:Image>
</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<td class="CellValue">
<p class="casual">
<a href="task.aspx?ID=<%# ((System.Data.DataRowView)Container.DataItem)[" Task_ID "]%>">
<%# string.Format("{0:#,##0}",((System.Data.DataRowView)Container.DataItem)["Title"])%>
</a>
</p>
</td>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
and this is the code behind:
override protected void OnInit(EventArgs e) {
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent() {
this.repBugs.ItemDataBound += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.repBugs_ItemDataBound);
}
private void repBugs_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e) {
//code
}
Now that asp code is different and uses an UpdatePanel. Now since I've been using UpdatePanel and since the code was changed and when I leave the same code behind it throws me an error on this part (this.repBugs.ItemDataBound += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.repBugs_ItemDataBound);) and this error was written to me: UpdatePanel does not contain a definition for ItemDataBound. What should i put instead of this ItemDataBound?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
