Repeater control causing an invalid callback or callback argument

I read many questions related to my situation, but I did not find what it was doing. Currently, I have a repeater with 4 related elements, clicking on the button in the repeater causes my error, below is the markup and code. Can someone explain to me why this is happening and fix it? (I excluded the page declaration and simply included the page_load event. Let me know if I should cut and skip the full code)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title></title>
</head>
<body>
  <form id="form1" runat="server">
  <div>
    <asp:Repeater ID="rptFoo" runat="server">
      <ItemTemplate>
        <asp:Button ID="btnfoo" runat="server" />
      </ItemTemplate>
    </asp:Repeater>
  </div>
  </form>
</body>
</html>

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim items As New List(Of String)
items.Add("test1")
items.Add("test2")
items.Add("test3")
items.Add("test4")
rptFoo.DataSource = items
rptFoo.DataBind()
End Sub
+5
source share
3 answers
+4

, Repeater datasource (binding) item. if(not ispostback) page_load.

+3

,

DataBind(). , , DataBind() , , .

, if (! IsPostback) DataBind(), DataBind() . , .

, JavaScript, .

0

All Articles