Usually we see a partial refresh thinking about Ajax, but what I'm going to say today is a C # control that can be partially refreshed by placing the server button and the area to be refreshed within the control.
Of course it must be used in conjunction with the ScriptManager control.
UpdatePanel important attributes are as follows:
Property |
Description |
Childrenastriggers |
When the UpdateMode property is conditional, the asynchronous loopback of child controls in UpdatePanel will raise Updatepanle updates. |
Rendermode |
Represents the HTML element that UpdatePanel eventually renders. Block (default) indicates that <div>,inline <span> |
UpdateMode |
Represents the update mode for UpdatePanel, with two options: Always and conditional. Always is whether or not trigger, other controls will update the updatepanel,conditional to represent only the trigger of the current UpdatePanel, Or the Childrenastriggers property is true when the control in the current UpdatePanel throws an asynchronous loopback or full-page loopback, or the server-side call to the update () method raises the update UpdatePanel. |
Here's a small example:
Front-End Code:
<%@ page language= "C #" autoeventwireup= "true" codebehind= "WebForm4.aspx.cs" inherits= "WEBAPPLICATION2.WEBFORM4"% ><! DOCTYPE html>Back-End Code:
Using system;using system.collections.generic;using system.linq;using system.web;using System.Web.UI;using System.web.ui.webcontrols;namespace webapplication2{public partial class WebForm4:System.Web.UI.Page { protected void Page_Load (object sender, EventArgs e) { } public void CCC (object sender, EventArgs e) {this . textbox1.text= "Hello UpdatePanel"; THIS.IFRAMESUN.ATTRIBUTES.ADD ("src", "https://www.baidu.com/");}}}
So we realized, do not refresh the entire page, get TextBox1 assignment, and loaded a Baidu iframe.
C # implements local refresh with UpdatePanel