vs. net control updatePanel implements a refreshing method

  • 2020-06-03 06:17:46
  • OfStack

Page section

<asp:ScriptManager ID="ScriptManager1" runat="server">
         use VS controls updatePanel Implement no refresh 
        &nbsp;<asp:UpdatePanel ID="UpdatePanel1" RenderMode="Block" UpdateMode="Conditional" runat="server">
             Click the button to get the current time from the server <asp:TextBox ID="txtTime" runat="server"></asp:TextBox>
            <asp:Button ID="btn1" runat="server" Text="Button" onclick="btn1_Click" />
        <%--<asp:PostBackTrigger ControlID="btn1" />--%>
        <asp:AsyncPostBackTrigger ControlID="btn1"/>

The background code

       protected void btn1_Click(object sender, EventArgs e)
            txtTime.Text = DateTime.Now.ToString();

Related articles: