Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET: "Object Required" when repeating LinkButtons in an UpdatePanel
    text
    copied!<p>I have an UpdatePanel which has a Repeater repeating LinkButtons. When I click a LinkButton, the page does a partial postback, then I get a javascript error: "Object required". I tried debugging the javascript, but couldn't get a call stack. If I remove the UpdatePanel, the LinkButtons do a full postback, and they disappear from the page. How can I get this UpdatePanel to work?</p> <pre><code>&lt;ajax:UpdatePanel ID="wrapperUpdatePanel" runat="server" UpdateMode="Always"&gt; &lt;ContentTemplate&gt; &lt;asp:Repeater ID="endpointRepeater" runat="server" OnItemDataBound="EndpointDataBound"&gt; &lt;HeaderTemplate&gt; &lt;div class="sideTabs"&gt; &lt;ul&gt; &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;li&gt; &lt;asp:LinkButton ID="endpointLink" runat="server" OnClick="EndpointSelected" /&gt; &lt;/li&gt; &lt;/ItemTemplate&gt; &lt;FooterTemplate&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/FooterTemplate&gt; &lt;/asp:Repeater&gt; &lt;/ContentTemplate&gt; &lt;/ajax:UpdatePanel&gt; </code></pre> <p>binding code:</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { this.SelectedEndpoint = Factory.Get&lt;IEndpoint&gt;(Enums.EndPoints.Marketing); } IEndpointCollection col = EndpointCollection.GetActivelySubscribingEndpointsForPart(this.Item); if (this.Item.IsGdsnItem) col.Add(Factory.Get&lt;IEndpoint&gt;(Enums.EndPoints.Gdsn)); if (col.Count &gt; 0) col.Insert(0, Factory.Get&lt;IEndpoint&gt;(Enums.EndPoints.Marketing)); this.endpointRepeater.DataSource = col; this.endpointRepeater.DataBind(); if (this.endpointRepeater.Items.Count &gt; 0) { LinkButton lb = this.endpointRepeater.Items[0].FindControl("endpointLink") as LinkButton; this.EndpointSelected(lb, new EventArgs()); } } </code></pre> <p>thanks, mark</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload