views:

68

answers:

0

Hi, As the topic describes, i have a listview inside of an updatePanel which is causing me some problems. Each item in the listview has an edit command button, which works perfectly fine when not using the updatePanel. When using the updatePanel however, only the button in the very first item works. The other buttons fire an asyncPostback, but don't actually do what they're suppose to.

Here's the markup:

<asp:ScriptManager ID="ScriptManager" runat="server" EnablePartialRendering="true"></asp:ScriptManager>
<asp:UpdatePanel id="updErrors" runat="server" ChildrenAsTriggers="true" UpdateMode="Always">
    <ContentTemplate>
        <asp:Label runat="server" ID="lblErrorCount" />
        <asp:ListView runat="server" ID="lstErrors"
            ItemPlaceholderID="itemPlaceHolder"
            OnItemEditing="lstErrors_ItemEditing" 
            OnItemCanceling="lstErrors_ItemCancelingEdit" 
            OnItemUpdating="lstErrors_ItemUpdating"
            OnItemDeleting="lstErrors_ItemDeleting"
            OnDataBound="lstErrors_DataBound">
            <LayoutTemplate>
                <table class="table_results">
                    <tr><th>Field</th><th>Value</th><th>Reason</th><th>Edit</th></tr>
                    <asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder>
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <tr class="group"><td colspan="4"><asp:label runat="server" id="lblGroup" Text='<%# Bind("DisplayName") %>'></asp:label></td></tr>
                <tr>
                    <td><asp:label runat="server" id="lblField" Text='<%# Bind("Field") %>'></asp:label></td>
                    <td><asp:label runat="server" id="lblValue" Text='<%# Bind("Value") %>'></asp:label></td>
                    <td><asp:label runat="server" id="lblReason" Text='<%# Bind("Reason") %>'></asp:label></td>
                    <td><asp:Button ID="lstEdit" runat="server" CommandName="Edit" Text="Edit" /></td>
                </tr>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <tr class="group"><td colspan="4"><asp:label runat="server" id="lblGroup" Text='<%# Bind("DisplayName") %>'></asp:label></td></tr>
                <tr class="alt">
                    <td><asp:label runat="server" id="lblField" Text='<%# Bind("Field") %>'></asp:label></td>
                    <td><asp:label runat="server" id="lblValue" Text='<%# Bind("Value") %>'></asp:label></td>
                    <td><asp:label runat="server" id="lblReason" Text='<%# Bind("Reason") %>'></asp:label></td>
                    <td><asp:Button ID="btnEdit" runat="server" CommandName="Edit" Text="Edit" /></td>
                </tr>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <tr class="group"><td colspan="4"><asp:label runat="server" id="lblGroup" Text='<%# Bind("DisplayName") %>'></asp:label></td></tr>
                <tr>
                    <td><asp:label runat="server" id="lblFieldEdit" Text='<%# Bind("Field") %>'></asp:label></td>
                    <td><asp:textbox runat="server" id="txtValueEdit" Text='<%# Bind("Value") %>'></asp:textbox></td>
                    <td><asp:label runat="server" id="lblReasonEdit" Text='<%# Bind("Reason") %>'></asp:label></td>
                    <td>
                        <asp:Button ID="btnUpdate" runat="server" CommandName="Update" Text="Update" />
                        <asp:Button ID="btnCancel" runat="server" CommandName="Cancel" Text="Cancel" />
                    </td>
                </tr>
            </EditItemTemplate>
        </asp:ListView>
        </ContentTemplate> 
    </asp:UpdatePanel>