国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

asp.net UpdaeProgress的簡(jiǎn)單用法

2024-07-10 12:39:37
字體:
供稿:網(wǎng)友
UpdateProgress 應(yīng)該就是“更新進(jìn)度” 的意思吧。
使用方法:
1.添加一個(gè)ScriptManager控件
2.添加一個(gè)UpdatePanel控件
3.添加一個(gè)UpdateProgress控件
設(shè)置UpdateProgress控件的AssociatedUpdatePanelID為第2步 UpdatePanel的ID(如果頁面中有多個(gè)UpdatePanel則,只有相應(yīng)updatePanel關(guān)聯(lián)的updateProgress顯示)
測(cè)試?yán)哟a: 
代碼如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
<style type="text/css">
#UpdatePanel1, #UpdatePanel2, #UpdateProgress1 {
border-right: gray 1px solid; border-top: gray 1px solid;
border-left: gray 1px solid; border-bottom: gray 1px solid;
}
#UpdatePanel1, #UpdatePanel2 {
width:200px; height:200px; position: relative;
float: left; margin-left: 10px; margin-top: 10px;
}
#UpdateProgress3 {
width: 200px; background-color: #FFC080;
bottom: 0%; left: 0px; position: absolute;
}
#UpdateProgress2 {
width: 200px; background-color: #FFC080;
bottom: 0%; left: 0px; position: absolute;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="Button" />
<asp:Label ID="Label1" runat="server" Text="顯示數(shù)據(jù)"></asp:Label>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<div id="progress"><img src="img/1.gif" />
等待中...
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click1" Text="Button" /><br />
<br />
<asp:Label ID="Label2" runat="server" Text="顯示數(shù)據(jù)"></asp:Label>
<asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel2">
<ProgressTemplate>
更新數(shù)據(jù)中....
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>

c#代碼:
代碼如下:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 云和县| 大冶市| 藁城市| 靖州| 屏边| 平远县| 平原县| 吴江市| 天水市| 绥江县| 桦川县| 晴隆县| 浦江县| 长泰县| 湘阴县| 澎湖县| 阿荣旗| 稷山县| 南漳县| 竹山县| 辉南县| 台南市| 周至县| 龙门县| 松溪县| 南华县| 宁陵县| 阿荣旗| 无为县| 英超| 东方市| 衢州市| 内黄县| 赫章县| 望江县| 定结县| 图木舒克市| 新郑市| 铜鼓县| 墨江| 福贡县|