《Programming ASP.NET》(中文版)笔记二——第五章:高级控件
2010-01-11 14:57
330 查看
MultiView和View控件:
MultiView控件的4个CommandName字段:NextView、PrevView、SwitchViewByID和SwitchViewByIndex。
<asp:Button CommandName="PrevView" ID="btnPrevious4" runat="server" Text="Go to Previous" />
<asp:Button CommandArgument="0" CommandName="SwitchViewByIndex" ID="btnFirst" runat="server" Text="Go to First" />
每一个view控件都声明了OnActivate和Ondeactivate事件处理程序,
<asp:View ID="vwThird" runat="server" OnActivate="ActivateView" OnDeactivate="DeactivateView">
Activate和Deactivate事件处理程序:
protected void ActivateView(object sender, EventArgs e)
{
string str = lblViewActivation.Text;
View v = (View)sender;
str += "View " + v.ID + " activated <br/>";
lblViewActivation.Text = str;
}
protected void DeactivateView(object sender, EventArgs e)
{
string str = lblViewActivation.Text;
View v = (View)sender;
str += "View " + v.ID + " deactivated <br/>";
lblViewActivation.Text = str;
}
Wizard控件
FileUpload控件
AdRotator控件:
该控件会引发AdCreated事件,该事件在每次回发到服务器且控件被创建之后呈现页面之前的引发。
protected void ad_AdCreated(object sender, AdCreatedEventArgs e)
{
if ((string)e.AdProperties["Animal"] != "")
l blAnimal.Text = (string)e.AdProperties["Animal"];
else
l blAnimal.Text = "n.a.";
}
AdProperties属性返回一个Dictionary。当获取AdProperties属性时,它会隐式地调用Dictionary对象的Item方法,它返回一个与字典项相应的值,该字典项的关键字是Animal,该值然后被转换为字符串,在C#中,它使用下面的语法完成:
(string)e.AdProperties["Animal"];
Calendar控件
MultiView控件的4个CommandName字段:NextView、PrevView、SwitchViewByID和SwitchViewByIndex。
<asp:Button CommandName="PrevView" ID="btnPrevious4" runat="server" Text="Go to Previous" />
<asp:Button CommandArgument="0" CommandName="SwitchViewByIndex" ID="btnFirst" runat="server" Text="Go to First" />
每一个view控件都声明了OnActivate和Ondeactivate事件处理程序,
<asp:View ID="vwThird" runat="server" OnActivate="ActivateView" OnDeactivate="DeactivateView">
Activate和Deactivate事件处理程序:
protected void ActivateView(object sender, EventArgs e)
{
string str = lblViewActivation.Text;
View v = (View)sender;
str += "View " + v.ID + " activated <br/>";
lblViewActivation.Text = str;
}
protected void DeactivateView(object sender, EventArgs e)
{
string str = lblViewActivation.Text;
View v = (View)sender;
str += "View " + v.ID + " deactivated <br/>";
lblViewActivation.Text = str;
}
Wizard控件
FileUpload控件
AdRotator控件:
该控件会引发AdCreated事件,该事件在每次回发到服务器且控件被创建之后呈现页面之前的引发。
protected void ad_AdCreated(object sender, AdCreatedEventArgs e)
{
if ((string)e.AdProperties["Animal"] != "")
l blAnimal.Text = (string)e.AdProperties["Animal"];
else
l blAnimal.Text = "n.a.";
}
AdProperties属性返回一个Dictionary。当获取AdProperties属性时,它会隐式地调用Dictionary对象的Item方法,它返回一个与字典项相应的值,该字典项的关键字是Animal,该值然后被转换为字符串,在C#中,它使用下面的语法完成:
(string)e.AdProperties["Animal"];
Calendar控件
相关文章推荐
- 《Programming ASP.NET》(中文版)笔记一——第四章:基本控件
- Programming ASP.NET 学习笔记(要点)第3章 控件:基本概念
- 《Programming ASP.NET》(中文版)笔记三——第六章:网站基础
- 愿我们共同进步——献给《Programming ASP.NET 3rd. 中文版》
- 常用控件产品官方文档/手册/API列表 c#控件文档API列表 asp.net控件产品技术文档中文版
- Asp.net控件开发学习笔记(六)----数据回传
- ASP.NET 高级程序设计学习笔记 -- 20130505
- ASP.NET笔记之 控件与母板的区别分析
- [ASP.NET笔记] 4.常用Web服务器控件
- ASP.NET高级中的SiteMapPath控件的使用
- 【转载】ASP.Net WebForm温故知新学习笔记:一、aspx与服务器控件探秘
- 技术笔记1_ASP.net:如何让DropDownList之类的单值绑定控件绑定多个字段值
- 【摘录】ASP.NET 2.0服务器控件与组件开发高级编程(第2章摘录1)
- ASP.NET Ajax 控件DropShadow,DropDown CollapsiblePanel 学习笔记
- telerik asp.net 控件学习笔记之————Calendar
- ASP.NET 2.0高级数据处理之处理控件事件
- ASP.NET学习笔记[8] - 梅花雨日历控件与textbox控件用法
- [翻译]asp.net 1.x/2.0中的高级列表控件
- 【学习笔记】〖ASP.NET〗在后台代码中取到控件旧值的解决办法
- Asp.net完美日历控件,支持FireFox,IE7(AjaxControlToolKit.Calendar)中文版