I do register a method for the ItemDataBound – Event like this:
protected void Page_Init(object sender, System.EventArgs e)
{
MyRepeater.ItemDataBound += MyRepeater_ItemDataBound;
// ...
}
protected void MyRepeater_ItemDataBound(object sender,
System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
// ...
}
Like this, nothing is triggered, the method is never executed.
When I register the method in code-before like
<asp:Repeater ID="MyRepeater" runat="server"
OnItemDataBound="MyRepeater_ItemDataBound">
it does work. Why doesn’t the former version work?
Thx for any tipps sl3dg3
You might be missing
AutoEventWireup=truein Page header in aspx file.Edit:
If buttons handlers do work, perhaps it’s problem with databinging – are you sure you are calling
DataBindonMyRepeateror any of it’s parent control? If you are callingDataBindmanually, does it depend onPage.IsPostBackon your page?