日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

使用UpdatePanel控件

系統(tǒng) 2142 0

使用UpdatePanel控件(二)

UpdatePanel可以用來(lái)創(chuàng)建豐富的局部更新Web應(yīng)用程序,它是ASP.NET 2.0 AJAX Extensions中很重要的一個(gè)控件,其強(qiáng)大之處在于不用編寫任何客戶端腳本,只要在一個(gè)頁(yè)面上添加幾個(gè)UpdatePanel控件和一個(gè)ScriptManager控件就可以自動(dòng)實(shí)現(xiàn)局部更新。通過(guò)本文來(lái)學(xué)習(xí)一下UpdatePanel其他的一些使用方法(第二篇)。

?

主要內(nèi)容

1.用編程的方法控制UpdatePanel的更新

2.UpdatePanel的嵌套使用

3.同一頁(yè)面上使用多個(gè)UpdatePanel

?

一.用編程的方法控制UpdatePanel的更新

對(duì)于UpdatePanel,我們也可以使用編程的方法來(lái)控制它的更新,可以通過(guò)ScriptManager的RegisterAsyncPostBackControl()方法注冊(cè)一個(gè)異步提交的控件,并且調(diào)用UpdatePanel的Update()方法來(lái)讓它更新。再次用我在前面的文章中用到的一個(gè)無(wú)聊的時(shí)間更新例子來(lái)看一下,有時(shí)候我覺(jué)得例子過(guò)于復(fù)雜更加不好說(shuō)明白所要講的內(nèi)容,如下代碼所示,注意Button1并不包含在UpdatePanel中:

?

<%@?Page?Language="C#"?AutoEventWireup="true"?CodeFile="Default.aspx.cs"?Inherits="_Default"?%>

<script?runat="server">

????void?Button1_Click(object?sender,?EventArgs?e)

????{

????????this.Label2.Text?=?DateTime.Now.ToString();

????}

</script>

<html?xmlns="http://www.w3.org/1999/xhtml">

<head?runat="server">

????<title>Refreshing?an?UpdatePanel?Programmatically</title>

</head>

<body>

????<form?id="form1"?runat="server">

????????<asp:ScriptManager?ID="ScriptManager1"?runat="server"/>

????????<div>

????????????<asp:UpdatePanel?ID="UpdatePanel1"?runat="server"?UpdateMode="Conditional">

????????????????<ContentTemplate>

????????????????????<asp:Label?ID="Label1"?runat="server"?Text="更新時(shí)間:"></asp:Label>

????????????????????<asp:Label?ID="Label2"?runat="server"?Text="Label"?ForeColor="Red"></asp:Label><br/><br/>

????????????????????

????????????????</ContentTemplate>

????????????</asp:UpdatePanel>

?????????????<asp:Button?ID="Button1"?runat="server"?Text="Button"??OnClick?=?"Button1_Click"/>

????????</div>

????</form>

</body>

</html>

這時(shí)候不用多說(shuō),肯定是整頁(yè)提交了,運(yùn)行如下圖所示:

?

再次修改上面的例子,使用ScriptManager的RegisterAsyncPostBackControl()注冊(cè)Button1為一個(gè)異步提交控件,并且調(diào)用UpdatePanel的Update()方法:

<%@?Page?Language="C#"?AutoEventWireup="true"?CodeFile="Default.aspx.cs"?Inherits="_Default"?%>

<script?runat="server">

????void?Page_Load(object?sender,?EventArgs?e)

????{

????????ScriptManager1.RegisterAsyncPostBackControl(Button1);

????}

????

????void?Button1_Click(object?sender,?EventArgs?e)

????{

????????this.Label2.Text?=?DateTime.Now.ToString();

????????this.UpdatePanel1.Update();

????}

</script>

<html?xmlns="http://www.w3.org/1999/xhtml">

<head?runat="server">

????<title>Refreshing?an?UpdatePanel?Programmatically</title>

</head>

<body>

????<form?id="form1"?runat="server">

????????<asp:ScriptManager?ID="ScriptManager1"?runat="server"/>

????????<div>

????????????<asp:UpdatePanel?ID="UpdatePanel1"?runat="server"?UpdateMode="Conditional">

????????????????<ContentTemplate>

????????????????????<asp:Label?ID="Label1"?runat="server"?Text="更新時(shí)間:"></asp:Label>

????????????????????<asp:Label?ID="Label2"?runat="server"?Text="Label"?ForeColor="Red"></asp:Label><br/><br/>

????????????????????

????????????????</ContentTemplate>

????????????</asp:UpdatePanel>

?????????????<asp:Button?ID="Button1"?runat="server"?Text="Button"??OnClick?=?"Button1_Click"/>

????????</div>

????</form>

</body>

</html>

這時(shí)候可以看到,已經(jīng)是異步提交了:

?

二.?UpdatePanel的嵌套使用

UpdatePanel還可以嵌套使用,即在一個(gè)UpdatePanel的ContentTemplate中還可以放入另一個(gè)UpdatePanel。當(dāng)最外面的UpdatePanel被觸發(fā)更新時(shí),它里面的子UpdatePanel也隨著更新,里面的UpdatePanel觸發(fā)更新時(shí),只更新它自己,而不會(huì)更新外層的UpdatePanel。看下面的例子:

<%@?Page?Language="C#"?AutoEventWireup="true"?CodeFile="Default2.aspx.cs"?Inherits="Default2"?%>

<script?runat="server">

</script>

?

<html?xmlns="http://www.w3.org/1999/xhtml">

<head?id="Head1"?runat="server">

????<title>UpdatePanelUpdateMode?Example</title>

????<style?type="text/css">

????div.NestedPanel

????{

??????position:?relative;

??????margin:?2%?5%?2%?5%;

????}

????</style>

</head>

<body>

????<form?id="form1"?runat="server">

????????<div>

????????????<asp:ScriptManager?ID="ScriptManager"?

???????????????????????????????runat="server"?/>

????????????<asp:UpdatePanel?ID="OuterPanel"?

?????????????????????????????UpdateMode="Conditional"?

?????????????????????????????runat="server">

????????????????<ContentTemplate>

????????????????????<div>

????????????????????????<fieldset>

????????????????????????????<legend>Outer?Panel?</legend>

????????????????????????????<br?/>

????????????????????????????<asp:Button?ID="OPButton1"?

????????????????????????????????????????Text="Outer?Panel?Button"?

????????????????????????????????????????runat="server"?/>

????????????????????????????<br?/>

????????????????????????????Last?updated?on

????????????????????????????<%=?DateTime.Now.ToString()?%>

????????????????????????????<br?/>

????????????????????????????<br?/>

????????????????????????????<asp:UpdatePanel?ID="NestedPanel1"?

???????????????????????????????????????????????UpdateMode="Conditional"

???????????????????????????????????????????????runat="server">

????????????????????????????????<ContentTemplate>

????????????????????????????????????<div?class="NestedPanel">

????????????????????????????????????????<fieldset>

????????????????????????????????????????????<legend>Nested?Panel?1</legend>

????????????????????????????????????????????<br?/>

????????????????????????????????????????????Last?updated?on

????????????????????????????????????????????<%=?DateTime.Now.ToString()?%>

????????????????????????????????????????????<br?/>

????????????????????????????????????????????<asp:Button?ID="NPButton1"

????????????????????????????????????????????????????????Text="Nested?Panel?1?Button"?

????????????????????????????????????????????????????????runat="server"?/>

????????????????????????????????????????</fieldset>

????????????????????????????????????</div>

????????????????????????????????</ContentTemplate>

????????????????????????????</asp:UpdatePanel>

????????????????????????</fieldset>

????????????????????</div>

????????????????</ContentTemplate>

????????????</asp:UpdatePanel>

????????</div>

????</form>

</body>

</html>

運(yùn)行后如下:

?

三.同一頁(yè)面上使用多個(gè)UpdatePanel

使用UpdatePanel的時(shí)候并沒(méi)有限制在一個(gè)頁(yè)面上用多少個(gè)UpdatePanel,所以我們可以為不同的需要局部更新的頁(yè)面區(qū)域加上不同的UpdatePanel。由于UpdatePanel默認(rèn)的UpdateMode是Always,如果頁(yè)面上有一個(gè)局部更新被觸發(fā),則所有的UpdatePanel都將更新,這是我們不愿看到的,我們只需要UpdatePanel在它自己的觸發(fā)器觸發(fā)的時(shí)候更新就可以了,所以需要把UpdateMode設(shè)置為Conditional。

來(lái)看一下官方網(wǎng)站上提供的一個(gè)例子:包括兩個(gè)UpdatePanel,其中一個(gè)用來(lái)用戶輸入而另一個(gè)則用來(lái)顯示數(shù)據(jù),每一個(gè)UpdatePanel的UpdateMode屬性都設(shè)置為Conditional。當(dāng)我們單擊Cancel按鈕時(shí),只有用來(lái)用戶輸入的那個(gè)UpdatePanel刷新,當(dāng)單擊Insert按鈕時(shí),兩個(gè)UpdatePanel都刷新。代碼如下:

?

<%@?Page?Language="C#"?%>

<%@?Import?Namespace="System.Collections.Generic"?%>

?

<html?xmlns="http://www.w3.org/1999/xhtml"?>

<head?id="Head1"?runat="server">

????<title>Enter?New?Employees</title>

????<script?runat="server">

????????private?List<Employee>?EmployeeList;

?

????????protected?void?Page_Load()

????????{

????????????if?(!IsPostBack)

????????????{

????????????????EmployeeList?=?new?List<Employee>();

????????????????EmployeeList.Add(new?Employee(1,?"Jump",?"Dan"));

????????????????EmployeeList.Add(new?Employee(2,?"Kirwan",?"Yvette"));

????????????????ViewState["EmployeeList"]?=?EmployeeList;

????????????}

????????????else

????????????????EmployeeList?=?(List<Employee>)ViewState["EmployeeList"];

????????????

????????????EmployeesGridView.DataSource?=?EmployeeList;

????????????EmployeesGridView.DataBind();

????????}

????????

????????protected?void?InsertButton_Click(object?sender,?EventArgs?e)

????????{

????????????if?(String.IsNullOrEmpty(FirstNameTextBox.Text)?||

???????????????String.IsNullOrEmpty(LastNameTextBox.Text))?{?return;?}

?

????????????int?employeeID?=?EmployeeList[EmployeeList.Count-1].EmployeeID?+?1;

????????????

????????????string?lastName?=?Server.HtmlEncode(FirstNameTextBox.Text);

????????????string?firstName?=?Server.HtmlEncode(LastNameTextBox.Text);

????????????

????????????FirstNameTextBox.Text?=?String.Empty;

????????????LastNameTextBox.Text?=?String.Empty;

????????????

????????????EmployeeList.Add(new?Employee(employeeID,?lastName,?firstName));

????????????ViewState["EmployeeList"]?=?EmployeeList;

????????????

????????????EmployeesGridView.DataBind();

????????????EmployeesGridView.PageIndex?=?EmployeesGridView.PageCount;

????????}

?

????????protected?void?CancelButton_Click(object?sender,?EventArgs?e)

????????{

????????????FirstNameTextBox.Text?=?String.Empty;

????????????LastNameTextBox.Text?=?String.Empty;

????????}

????

????????[Serializable]

????????public?class?Employee

????????{

????????????private?int?_employeeID;

????????????private?string?_lastName;

????????????private?string?_firstName;

?

????????????public?int?EmployeeID

????????????{

????????????????get?{?return?_employeeID;?}

????????????}

????????????

????????????public?string?LastName

????????????{

????????????????get?{?return?_lastName;?}

????????????}

????????????

????????????public?string?FirstName

????????????{

????????????????get?{?return?_firstName;?}

????????????}

????????????

????????????public?Employee(int?employeeID,?string?lastName,?string?firstName)

????????????{

????????????????_employeeID?=?employeeID;

????????????????_lastName?=?lastName;

????????????????_firstName?=?firstName;

????????????}

????????}

?

????</script>

</head>

<body>

????<form?id="form1"?runat="server">

????<div>

????????&nbsp;</div>

????????<asp:ScriptManager?ID="ScriptManager1"?runat="server"?EnablePartialRendering="true"?/>

????????<table>

????????????<tr>

????????????????<td?style="height:?206px"?valign="top">

????????????????????<asp:UpdatePanel?ID="InsertEmployeeUpdatePanel"?runat="server"?UpdateMode="Conditional">

????????????????????????<ContentTemplate>

??????????????????????????<table?cellpadding="2"?border="0"?style="background-color:#7C6F57">

????????????????????????????<tr>

??????????????????????????????<td><asp:Label?ID="FirstNameLabel"?runat="server"?AssociatedControlID="FirstNameTextBox"?

?????????????????????????????????????????????Text="First?Name"?ForeColor="White"?/></td>

??????????????????????????????<td><asp:TextBox?runat="server"?ID="FirstNameTextBox"?/></td>

????????????????????????????</tr>

????????????????????????????<tr>

??????????????????????????????<td><asp:Label?ID="LastNameLabel"?runat="server"?AssociatedControlID="LastNameTextBox"?

?????????????????????????????????????????????Text="Last?Name"?ForeColor="White"?/></td>

??????????????????????????????<td><asp:TextBox?runat="server"?ID="LastNameTextBox"?/></td>

????????????????????????????</tr>

????????????????????????????<tr>

??????????????????????????????<td></td>

??????????????????????????????<td>

????????????????????????????????<asp:LinkButton?ID="InsertButton"?runat="server"?Text="Insert"?OnClick="InsertButton_Click"?ForeColor="White"?/>

????????????????????????????????<asp:LinkButton?ID="Cancelbutton"?runat="server"?Text="Cancel"?OnClick="CancelButton_Click"?ForeColor="White"?/>

??????????????????????????????</td>

????????????????????????????</tr>

??????????????????????????</table>

??????????????????????????<asp:Label?runat="server"?ID="InputTimeLabel"><%=DateTime.Now?%></asp:Label>

????????????????????????</ContentTemplate>

????????????????????</asp:UpdatePanel>

????????????????</td>

????????????????<td?style="height:?206px"?valign="top">

????????????????????<asp:UpdatePanel?ID="EmployeesUpdatePanel"?runat="server"?UpdateMode="Conditional">

????????????????????????<ContentTemplate>

????????????????????????????<asp:GridView?ID="EmployeesGridView"?runat="server"?BackColor="LightGoldenrodYellow"?BorderColor="Tan"

????????????????????????????????BorderWidth="1px"?CellPadding="2"?ForeColor="Black"?GridLines="None"?AutoGenerateColumns="False">

????????????????????????????????<FooterStyle?BackColor="Tan"?/>

????????????????????????????????<SelectedRowStyle?BackColor="DarkSlateBlue"?ForeColor="GhostWhite"?/>

????????????????????????????????<PagerStyle?BackColor="PaleGoldenrod"?ForeColor="DarkSlateBlue"?HorizontalAlign="Center"?/>

????????????????????????????????<HeaderStyle?BackColor="Tan"?Font-Bold="True"?/>

????????????????????????????????<AlternatingRowStyle?BackColor="PaleGoldenrod"?/>

????????????????????????????????<Columns>

????????????????????????????????????<asp:BoundField?DataField="EmployeeID"?HeaderText="Employee?ID"?/>

????????????????????????????????????<asp:BoundField?DataField="LastName"?HeaderText="Last?Name"?/>

????????????????????????????????????<asp:BoundField?DataField="FirstName"?HeaderText="First?Name"?/>

????????????????????????????????</Columns>

????????????????????????????????<PagerSettings?PageButtonCount="5"?/>

????????????????????????????</asp:GridView>

????????????????????????????<asp:Label?runat="server"?ID="ListTimeLabel"><%=DateTime.Now?%></asp:Label>

????????????????????????</ContentTemplate>

????????????????????????<Triggers>

????????????????????????????<asp:AsyncPostBackTrigger?ControlID="InsertButton"?EventName="Click"?/>

????????????????????????</Triggers>

????????????????????</asp:UpdatePanel>

????????????????</td>

????????????</tr>

????????</table>

????</form>

</body>

</html>

運(yùn)行后效果如下:

?

?

示例代碼下載: http://files.cnblogs.com/Terrylee/ASPNETAJAXUpdatePanelDemo2.rar

支持TerryLee的創(chuàng)業(yè)產(chǎn)品 Worktile
Worktile,新一代簡(jiǎn)單好用、體驗(yàn)極致的團(tuán)隊(duì)協(xié)同、項(xiàng)目管理工具,讓你和你的團(tuán)隊(duì)隨時(shí)隨地一起工作。完全免費(fèi),現(xiàn)在就去了解一下吧。
https://worktile.com
?

]??AJAX風(fēng)云

?
摘要: jQuery 是繼 prototype 之后又一個(gè)優(yōu)秀的 Javascript 框架。其宗旨是—寫更少的代碼,做更多的事情。它是輕量級(jí)的 js 庫(kù)(壓縮后只有21k) ,這是其它的 js 庫(kù)所不及的,它兼容 CSS3,還兼容各種瀏覽器,jQuery 是一個(gè)快速的,簡(jiǎn)潔的 javaScript 庫(kù),使用戶能更方便地處理 HTML documents、events、實(shí)現(xiàn)動(dòng)畫效果,并且方便地為網(wǎng)站提供 AJAX 交互。 jQuery 還有一個(gè)比較大的優(yōu)勢(shì)是,它的文檔說(shuō)明很全,而且各種應(yīng)用也說(shuō)得很詳細(xì),同時(shí)還有許多成熟的插件可供選擇。 jQuery 能夠使用戶的 html 頁(yè)保持代碼和 html 內(nèi)容分離,也就是說(shuō),不用再在 html 里面插入一堆js來(lái)調(diào)用命令了,只需定義 id 即可。今天在Kollermedia.at上發(fā)現(xiàn)了一篇JQuery插件列表的文章,里面包含了JQuery插件達(dá)240多個(gè),特推薦給大家。 閱讀全文
posted @? 2007-12-09 21:44 ?TerryLee 閱讀(334092) |? 評(píng)論 (208) ? 編輯
?
摘要: 1.姍姍來(lái)遲的ASP.NET AJAX 1.0正式版終于與大家見(jiàn)面了。這次發(fā)布的版本與RC之間的改動(dòng)如下:?
?……?
2.ASP.NET AJAX 1.0的全部源碼已經(jīng)發(fā)布。?
3.ASP.NET AJAX Control Toolkit也隨之發(fā)布了新版本,新增了如下四個(gè)控件:?
?AutoComplete?
?Calendar?
?MaskedEdit?
?Tabs?
4.未來(lái)開(kāi)發(fā)計(jì)劃?
詳細(xì)大家可以訪問(wèn):http://ajax.asp.net/?
閱讀全文
posted @? 2007-01-24 08:29 ?TerryLee 閱讀(15907) |? 評(píng)論 (107) ? 編輯
?
摘要: 原計(jì)劃年底R(shí)elease的ASP.NET AJAX 1.0,經(jīng)過(guò)了多個(gè)CTP版,2個(gè)Beta版本之后,終于發(fā)布了RC版。同時(shí)微軟提供了兩份升級(jí)文檔:?

從CTP版升級(jí)到RC 版?

從Beta2升級(jí)到RC版?

點(diǎn)擊下載ASP.NET AJAX 1.0 RC,從提供的文檔來(lái)看,主要的變化是命名空間,從Microsoft.Web變?yōu)榱薙ystem.Web,如以前的用的Microsoft.Web.Script.Services.ScriptService,現(xiàn)在需要修改為System.Web.Script.Services.ScriptService。?

同時(shí)ASP.NET AJAX Control Toolkit已經(jīng)更新到了RC版,可以從這里下載。?

點(diǎn)點(diǎn):從最近發(fā)布的Beta2到RC版,可以看出ASP.NET AJAX v1.0已經(jīng)逐步趨于穩(wěn)定,不會(huì)再有CTP到Beta1的翻天覆地的變化,大家可以在項(xiàng)目中使用了。 閱讀全文
posted @? 2006-12-15 09:14 ?TerryLee 閱讀(4685) |? 評(píng)論 (25) ? 編輯
?
摘要: 在CSDN首頁(yè)上用大標(biāo)題寫著“誰(shuí)來(lái)革AJAX的命,F(xiàn)lash還是WPF”,同時(shí)在下面列舉了Adobe推出Flex 2.0 力拼Ajax,以及袁紅崗在6月份的文章Ajax,只是一種過(guò)渡技術(shù),其中袁在文章中說(shuō)到“Ajax其實(shí)是一種新瓶裝舊酒的過(guò)渡技術(shù),相信在未來(lái)一到兩年之內(nèi)將被新的技術(shù)所代替,而JSF則是一種可擴(kuò)展的框架級(jí)解決方案。”?

AJAX自去年火了之后到現(xiàn)在,不僅沒(méi)有被取代,而且有越來(lái)越熱之勢(shì):現(xiàn)在各大網(wǎng)站都在爭(zhēng)相使用AJAX技術(shù),似乎哪個(gè)網(wǎng)站不使用點(diǎn)AJAX就顯的落伍了,從Google、到Y(jié)ahoo,以及國(guó)內(nèi)各門戶網(wǎng)站都是如此,不使用AJAX技術(shù),似乎就不夠Web2.0;各種AJAX框架也是風(fēng)起云涌,微軟的ASP.NET AJAX,雅虎的Yahoo! UI,Google的Web Toolkit以及dojo,prototype等;再看看園子里朋友對(duì)AJAX的關(guān)注程度,遠(yuǎn)遠(yuǎn)超出了對(duì)其他技術(shù)的關(guān)注。?

那么AJAX到底命運(yùn)如何,是否只是一種過(guò)渡技術(shù)?能否被Flex或者WPF所取代呢?我們不妨來(lái)一次討論,大家也都來(lái)說(shuō)說(shuō)自己的看法吧。 閱讀全文
posted @? 2006-11-20 14:30 ?TerryLee 閱讀(9604) |? 評(píng)論 (89) ? 編輯
?
摘要: 本文將使用Timer控件更新兩個(gè)UpdatePanel控件,Timer控件將放在UpdatePanel控件的外面,并將它配置為UpdatePanel的觸發(fā)器,翻譯自官方文檔。?

主要內(nèi)容?

在多個(gè)UpdatePanel中使用Timer控件?
閱讀全文
posted @? 2006-11-15 21:43 ?TerryLee 閱讀(16339) |? 評(píng)論 (53) ? 編輯
?
摘要: 本文簡(jiǎn)單介紹一下在母版頁(yè)中使用UpdatePanel控件,翻譯自官方文檔。?


主要內(nèi)容?

1.添加UpdatePanel控件到Content Page?

2.通過(guò)Master Page刷新UpdatePanel?
閱讀全文
posted @? 2006-11-13 18:00 ?TerryLee 閱讀(22151) |? 評(píng)論 (69) ? 編輯
?
摘要: 在UpdatePanel控件異步更新時(shí),如果有錯(cuò)誤發(fā)生,默認(rèn)情況下會(huì)彈出一個(gè)Alert對(duì)話框顯示出錯(cuò)誤信息,這對(duì)用戶來(lái)說(shuō)是不友好的,本文看一下如何在服務(wù)端和客戶端腳本中自定義異常處理,翻譯自官方文檔。?

主要內(nèi)容 ?

1.在服務(wù)端自定義異常處理?

2.在客戶端腳本中自定義異常處理?
閱讀全文
posted @? 2006-11-13 16:58 ?TerryLee 閱讀(17811) |? 評(píng)論 (37) ? 編輯
?
摘要: ASP.NET AJAX入門系列將會(huì)寫關(guān)于ASP.NET AJAX一些控件的使用方法以及基礎(chǔ)知識(shí),其中部分文章為原創(chuàng),也有一些文章是直接翻譯自官方文檔,本部分內(nèi)容會(huì)不斷更新。?

文章及導(dǎo)讀 閱讀全文
posted @? 2006-11-12 23:22 ?TerryLee 閱讀(219489) |? 評(píng)論 (148) ? 編輯
?
摘要: 在本篇文章中,我們將通過(guò)編寫JavaScript來(lái)使用客戶端行為擴(kuò)展UpdateProgress控件,客戶端代碼將使用ASP.NET AJAX Library中的PageRequestManager,在UpdateProgress控件中,將添加一個(gè)Button,來(lái)允許用戶取消異步更新,并且使用客戶端腳本來(lái)顯示或者隱藏進(jìn)度信息。?

主要內(nèi)容 ?

1.通過(guò)客戶端腳本取消異步更新?

2.通過(guò)客戶端腳本顯示或者隱藏進(jìn)度信息?
閱讀全文
posted @? 2006-11-12 22:59 ?TerryLee 閱讀(21071) |? 評(píng)論 (79) ? 編輯
?
摘要: 在ASP.NET AJAX Beta2中,UpdateProgress控件已經(jīng)從“增值”CTP中移到了ASP.NET AJAX核心中。以下兩篇關(guān)于UpdateProgress的文章基本翻譯自ASP.NET AJAX官方網(wǎng)站。?

主要內(nèi)容 ?

1.UpdateProgress控件簡(jiǎn)單使用?

2.使用多個(gè)UpdateProgress控件?

閱讀全文
posted @? 2006-11-12 15:57 ?TerryLee 閱讀(37076) |? 評(píng)論 (77) ? 編輯
?
摘要: UpdatePanel可以用來(lái)創(chuàng)建豐富的局部更新Web應(yīng)用程序,它是ASP.NET 2.0 AJAX Extensions中很重要的一個(gè)控件,其強(qiáng)大之處在于不用編寫任何客戶端腳本,只要在一個(gè)頁(yè)面上添加幾個(gè)UpdatePanel控件和一個(gè)ScriptManager控件就可以自動(dòng)實(shí)現(xiàn)局部更新。通過(guò)本文來(lái)學(xué)習(xí)一下UpdatePanel其他的一些使用方法(第二篇)。?

主要內(nèi)容?

1.用編程的方法控制UpdatePanel的更新?

2.UpdatePanel的嵌套使用?

3.同一頁(yè)面上使用多個(gè)UpdatePanel?
閱讀全文
posted @? 2006-11-01 22:00 ?TerryLee 閱讀(37180) |? 評(píng)論 (69) ? 編輯
?
摘要: UpdatePanel可以用來(lái)創(chuàng)建豐富的局部更新Web應(yīng)用程序,它是ASP.NET 2.0 AJAX Extensions中很重要的一個(gè)控件,其強(qiáng)大之處在于不用編寫任何客戶端腳本,只要在一個(gè)頁(yè)面上添加幾個(gè)UpdatePanel控件和一個(gè)ScriptManager控件就可以自動(dòng)實(shí)現(xiàn)局部更新。通過(guò)本文來(lái)學(xué)習(xí)一下UpdatePanel簡(jiǎn)單的使用方法(第一篇)。?

主要內(nèi)容 ?

1.UpdatePanel控件概述?

2.UpdatePanel工作原理?

3.ContentTemplate屬性?

4.ContentTemplateContainer屬性?

5.Triggers屬性?
閱讀全文
posted @? 2006-10-29 22:57 ?TerryLee 閱讀(70737) |? 評(píng)論 (124) ? 編輯
?
摘要: 在ASP.NET AJAX中,由于一個(gè)ASPX頁(yè)面上只能有一個(gè)ScriptManager控件,所以在有母版頁(yè)的情況下,如果需要在Master-Page和Content-Page中需要引入不同的腳本時(shí),這就需要在Content-page中使用ScriptManagerProxy,而不是ScriptManager,ScriptManager 和 ScriptManagerProxy 是兩個(gè)非常相似的控件。?

主要內(nèi)容 ?

1.ScriptManagerProxy控件概述?

2.簡(jiǎn)單示例?
閱讀全文
posted @? 2006-10-27 08:31 ?TerryLee 閱讀(36578) |? 評(píng)論 (96) ? 編輯
?
摘要: ScriptManager控件包括在ASP.NET 2.0 AJAX Extensions中,它用來(lái)處理頁(yè)面上的所有組件以及頁(yè)面局部更新,生成相關(guān)的客戶端代理腳本以便能夠在JavaScript中訪問(wèn)Web Service,所有需要支持ASP.NET AJAX的ASP.NET頁(yè)面上有且只能有一個(gè)ScriptManager控件。在ScriptManager控件中我們可以指定需要的腳本庫(kù),或者指定通過(guò)JS來(lái)調(diào)用的Web Service,以及調(diào)用AuthenticationService和ProfileService,還有頁(yè)面錯(cuò)誤處理等。?

主要內(nèi)容 ?

1.控件概述?

2.一個(gè)簡(jiǎn)單的示例?

3.客戶端腳本模式?

4.錯(cuò)誤處理?

5.Services屬性?

6.Scripts屬性 閱讀全文
posted @? 2006-10-25 23:16 ?TerryLee 閱讀(122017) |? 評(píng)論 (162) ? 編輯
?
摘要: 經(jīng)常關(guān)注我的Blog的朋友可能注意到了,在我Blog的左邊系列文章中,已經(jīng)移除了對(duì)Atlas學(xué)習(xí)手記系列文章的推薦,因?yàn)殡S著ASP.NET AJAX 1.0 Beta版的發(fā)布,它們已經(jīng)不再適用,為了不繼續(xù)誤導(dǎo)廣大朋友,所以不再作為推薦系列文章,如果有需要參考的朋友,可以直接到隨筆分類中查看。?

ASP.NET AJAX Beta改動(dòng)如此之大,鑒于又沒(méi)有很好的中文參考資料,所以決定最近開(kāi)始寫作ASP.NET AJAX入門系列,這個(gè)系列我會(huì)把ASP.NET AJAX當(dāng)作一個(gè)全新的東西去對(duì)待,不再考慮以前的Atlas,把自己對(duì)ASP.NET AJAX的研究與大家分享,便于初學(xué)的朋友少走一些彎路。對(duì)Atlas熟悉的朋友可以推薦看Dflying Chen的《擁抱變化——從Atlas到ASP.NET AJAX系列》,以及老趙的《深入Atlas系列》。由于個(gè)人的能力和掌握的程度有限 ,難免出現(xiàn)錯(cuò)誤和遺漏的地方,還請(qǐng)大家多多理解和指正。?

OK,讓我們從這里開(kāi)始!?
閱讀全文
posted @? 2006-10-24 23:14 ?TerryLee 閱讀(91322) |? 評(píng)論 (72) ? 編輯

使用UpdatePanel控件


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 江津市| 泰和县| 云阳县| 凌云县| 松滋市| 公主岭市| 额尔古纳市| 阳泉市| 武定县| 武汉市| 金寨县| 本溪| 略阳县| 通江县| 厦门市| 普洱| 永康市| 仪征市| 应用必备| 惠来县| 阳高县| 祁阳县| 中超| 扶余县| 冕宁县| 博客| 千阳县| 连江县| 晋宁县| 元朗区| 赞皇县| 荔浦县| 兴安县| 虞城县| 大安市| 隆子县| 紫金县| 岢岚县| 洛浦县| 历史| 通州区|