Is there any behavioral difference between:
<asp:Repeater ID="myRepeater" runat="server" OnItemDataBound="myRepeater_ItemDataBound">
</asp:Repeater>
vs:
protected void Page_Load(object sender, EventArgs e)
{
myRepeater.ItemDataBound += new RepeaterItemEventHandler(myRepeater_ItemDataBound);
}
No, there is no difference in execution, because in reality, when you assign it in the ascx, it’s actually written to a code behind “behind the scenes” in the .designer.cs file (assuming you’re using the designer) or in a compiled temp file (if using background compile).
They both do the same thing. But the aspx version can be handled by the GUI designer.