wsyeager36 wsyeager36

Niner since 2008


  • Update​Controls: ​Update​History and ​Animated​UpdatePanel

    There is no audio for this video...

    I tried using the UpdateHistory control, but it didn't work.

    The e.EntryName object had an empty string value.

    I just had a simple default.aspx page and page2.aspx page with two controls. A textbox and Button on Default.aspx and page2.aspx had a textbox.

    When going to page2, the value was in the textbox. When going back to default.aspx (via the Back button in the browser), the form data value originally in this page was gone.

    See my below code:

    <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <nStuff:UpdateHistory ID="UpdateHistory1" runat="server" OnNavigate="OnUpdateHistoryNavigate">
            <nStuff:AnimatedUpdatePanel ID="AnimatedUpdatePanel1" runat="server" UpdateMode="Conditional">
                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                    <br />
                        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />

    private Sub OnUpdateHistoryNavigate(ByVal sender As Object, ByVal e As HistoryEventArgs)
            ' Raised when the user navigates back/forward or
            ' loads a bookmark to a specific view.

            ' Use the history entry name to determine the
            ' selected index and update the page.
            If String.IsNullOrEmpty(e.EntryName) = False Then
                TextBox1.Text = e.EntryName.ToString
            End If


        End Sub

    Another point... If you do help me to get it to work, wouldn't I have to run a similiar "If" statement for EACH control on the page in order to repopulate the data? If this is the case, it seems awfully arduous and tedious to do this. It probably won't be feasible with all the controls that can exist on a page.