C # implements local refresh with UpdatePanel

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.