This article describes how to implement the VS control updatePanel to implement a brushless newest application. If you need it, you can take a look.
Page Section
The Code is as follows: |
Copy code |
<Asp: ScriptManager ID = "ScriptManager1" runat = "server"> </Asp: ScriptManager> <H2> Use the VS control updatePanel to achieve no refreshing </H2> <P> & Nbsp; <asp: UpdatePanel ID = "UpdatePanel1" RenderMode = "Block" UpdateMode = "Conditional" runat = "server"> <ContentTemplate> Click the button to obtain 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"/> </ContentTemplate> <Triggers> <% -- <Asp: PostBackTrigger ControlID = "btn1"/> -- %> <Asp: AsyncPostBackTrigger ControlID = "btn1"/> </Triggers> </Asp: UpdatePanel> </P> |
Background code
The Code is as follows: |
Copy code |
Protected void btn1_Click (object sender, EventArgs e) { TxtTime. Text = DateTime. Now. ToString (); } |