locked
DetailsView1_ItemUpdated To Refresh a FormView On the Same Page RRS feed

  • Question

  • User-635464745 posted

    I have a detailsview and formview control - the detailsview updates the information in the DB the formview control dislays the information in the DB

    When I do an Update, I want the formview to update and display the new information.

    I have an update panel that I am using for CSS formatting of the formview within an UpdatePanel control already.

    What would be the best way to accomplish this?

    thanks!

    Sunday, April 14, 2013 8:34 PM

All replies

  • User1100692814 posted

    Hi <g class="gr_ gr_8 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="8" data-gr-id="8">CarolosC</g>,

    You need to set triggers on the update panel and then update the FormView data source after the postback.

    <Triggers>
        <asp:AsyncPostBackTrigger controlid="btnSave" eventname="Click" />         
    </Triggers> 
    protected void btnSave_Click(object sender, EventArgs e)
    {
        UpdateFormView1();
    }

    Check out https://msdn.microsoft.com/en-us/library/bb399001.aspx or https://www.aspforums.net/Threads/153064/Bind-and-Auto-Refresh-GridView-inside-Update-Panel-with-Database-using-C-and-VBNet-in-ASPNet/

    Thanks

    D

    Monday, March 5, 2018 12:22 PM