最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

asp.net UpdaeProgress的簡單用法

 更新時間:2008年10月29日 22:18:01   作者:  
這個控件相比其他控件,屬性少 使用簡單,就先把這個控件的一般使用方法簡單紀錄下
UpdateProgress 應該就是“更新進度” 的意思吧。
使用方法:
1.添加一個ScriptManager控件
2.添加一個UpdatePanel控件
3.添加一個UpdateProgress控件
設置UpdateProgress控件的AssociatedUpdatePanelID為第2步 UpdatePanel的ID(如果頁面中有多個UpdatePanel則,只有相應updatePanel關聯(lián)的updateProgress顯示)
測試例子代碼: 
復制代碼 代碼如下:

<%@ 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;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Threading;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click1(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(3000);
Label1.Text = "刷新時間:" + DateTime.Now.ToString();
}
protected void Button2_Click1(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(3000);
Label2.Text = "刷新時間:" + DateTime.Now.ToString();
}
}

其中,頁面代碼中的css是msdn上的例子。UpdatePanel1中的UpdateProgress1顯示一張動態(tài)gif圖片
還往大哥大姐們多多指教。

相關文章

  • ASP.NET中 Panel 控件的使用方法

    ASP.NET中 Panel 控件的使用方法

    Panel 控件用作其它控件的容器,其實Panel本質就是一個DIV,本文主要介紹Panel控件的使用方法。
    2016-04-04
  • 那些年,我還在學習asp.net(二) 學習筆記

    那些年,我還在學習asp.net(二) 學習筆記

    那些年覺得看視頻是很輕松的了解一個東西,但是這樣的不足就是感覺太慢了,沒有看書來得快,所以在有了一些了解后,還得看點書,也許書上的不一定好,但書上會把每一個應該說到的地方說到,好有個初步的認識
    2012-03-03
  • ASP.NET Core中的Options選項模式

    ASP.NET Core中的Options選項模式

    這篇文章介紹了ASP.NET Core中的Options選項模式,文中通過示例代碼介紹的非常詳細。對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-04-04
  • Asp.Net上傳文件并配置可上傳大文件的方法

    Asp.Net上傳文件并配置可上傳大文件的方法

    這篇文章介紹了Asp.Net上傳文件并配置可上傳大文件的方法,文中通過示例代碼介紹的非常詳細。對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-05-05
  • ASP.NET中HyperLink超鏈接控件的使用方法

    ASP.NET中HyperLink超鏈接控件的使用方法

    本文主要介紹HyperLink控件的基礎用法以及在Repeater中綁定數(shù)據(jù)的一些技巧,希望能幫到大家。
    2016-04-04
  • ASP.NET中BulletedList列表控件使用及詳解

    ASP.NET中BulletedList列表控件使用及詳解

    本文主要介紹了ASP.NET中BulletedList列表控件的詳細使用方法,講解各屬性的含義以及三種顯示模式,希望能幫到大家。
    2016-04-04
  • 學會區(qū)分Visual Studio 2005,Visual Studio 2005 Team System和MSDN Premium 訂閱的各個版本

    學會區(qū)分Visual Studio 2005,Visual Studio 2005 Team System和MSDN P

    學會區(qū)分Visual Studio 2005,Visual Studio 2005 Team System和MSDN Premium 訂閱的各個版本...
    2007-01-01
  • ASP.NET?Core中的wwwroot文件夾

    ASP.NET?Core中的wwwroot文件夾

    這篇文章介紹了ASP.NET?Core中的wwwroot文件夾,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2022-02-02
  • ASP.NET?Core中的通用主機HostBuilder

    ASP.NET?Core中的通用主機HostBuilder

    這篇文章介紹了ASP.NET?Core中的通用主機HostBuilder,文中通過示例代碼介紹的非常詳細。對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-04-04
  • .Net中Task Parallel Library的基本用法

    .Net中Task Parallel Library的基本用法

    這篇文章介紹了.Net中Task Parallel Library的基本用法,文中通過示例代碼介紹的非常詳細。對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-10-10

最新評論

和田县| 湛江市| 抚顺县| 噶尔县| 凌源市| 翼城县| 化德县| 庄浪县| 共和县| 扎赉特旗| 象山县| 靖安县| 宁德市| 龙海市| 玉环县| 苏尼特右旗| 正镶白旗| 晋州市| 西林县| 田阳县| 西丰县| 景东| 宁强县| 古丈县| 乾安县| 兴义市| 济宁市| 沾化县| 辽中县| 武宁县| 高碑店市| 惠来县| 甘谷县| 通州市| 兴山县| 蓝田县| 海淀区| 江阴市| 齐河县| 桃源县| 景东|