Note that there are some explanatory texts on larger screens.

plurals
  1. PORespond to Button Events inside Repeater ItemTemplate
    primarykey
    data
    text
    <p>so i have removed the datasouce and just have DataBind() then my page is still blowing and refreshing the page and not in a EDIT mode.</p> <p>what i am trying to do is when the user click on Edit button then make it inline editing the repeater row.</p> <p><strong>END UPDATE</strong></p> <p>onItemCommand i have added DataBind()</p> <pre><code>rpt.DataSource = mydatasource; rpt.DataBind(); </code></pre> <p>after i do that my page is not in edit mode and it blow away and everyting is refreshed i have on page_load</p> <pre><code>if (!IsPostBack) { rpt.DataSource = mydatasource; rpt.DataBind(); } </code></pre> <p><strong>end update</strong></p> <p>I've used repeaters many times without problems but something is going on here. I have a repeater and I'm subscribing to the itemDatabound event, But when i click the button (which is a linkbutton inside my repeater itemtemplate) it does not go to the <code>ItemDataBound</code></p> <pre><code>&lt;asp:Repeater ID="rpt" runat="server" OnItemCommand="rpt_OnItemCommand" OnItemDataBound="rpt_OnItemDataBound"&gt; &lt;ItemTemplate&gt; &lt;li&gt; &lt;asp:Label ID="Label" runat="server" /&gt; &lt;asp:LinkButton ID="LinkButton1" runat="server" CommandName="edit" CommandArgument='&lt;%# Eval("MyID") %&gt;' Text='&lt;%# Eval("Title") %&gt;' /&gt; &lt;/li&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; protected void rpt_OnItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "delete") { //Data.Contacts.RemoveAt(e.Item.ItemIndex); } else if (e.CommandName == "edit") { EditIndex = e.Item.ItemIndex; } else if (e.CommandName == "save") { // } } protected void rpt_OnItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { if (e.Item.ItemIndex == EditIndex) { // never come to this line.... after the user click on LinkButton } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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