locked
Partial UpdatePanel RRS feed

  • Question

  • User1510859543 posted

    Is it possible to do a partial page update inside the ItemTemplate of a ListView?  I have a checkbox that I would like to update the underlying database when I check or uncheck the checkbox without doing a full postback.  The checkbox is 1 of about 20 columns on the ListView.  Thanks.

    Thursday, June 19, 2014 12:19 PM

Answers

  • User-1360095595 posted

    I think you need to wrap the entire listview in the updatepanel. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 19, 2014 3:41 PM
  • User-417640953 posted

    Hi dlchase,

    Thank you post the issue to asp.net forum.

    As other member suggested, you should set the ListView in UpdatePanel, not the UpdatePanel in ListView's ItemTemplate.

    That because the ListView is a databind control, it update data through rebind data to it and refresh all of its' content.

    So we cannot set UpdatePanel in DataBind control for a partial postback.

    http://msdn.microsoft.com/en-us/library/bb386452(v=vs.90).aspx

    <asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="true">
                    <ContentTemplate>
                        <asp:ListView ID="ListView1" runat="server">

    Hope this helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 21, 2014 4:01 AM

All replies

  • User-1360095595 posted

    I think you need to wrap the entire listview in the updatepanel. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 19, 2014 3:41 PM
  • User-417640953 posted

    Hi dlchase,

    Thank you post the issue to asp.net forum.

    As other member suggested, you should set the ListView in UpdatePanel, not the UpdatePanel in ListView's ItemTemplate.

    That because the ListView is a databind control, it update data through rebind data to it and refresh all of its' content.

    So we cannot set UpdatePanel in DataBind control for a partial postback.

    http://msdn.microsoft.com/en-us/library/bb386452(v=vs.90).aspx

    <asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="true">
                    <ContentTemplate>
                        <asp:ListView ID="ListView1" runat="server">

    Hope this helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 21, 2014 4:01 AM