ASP.NET数据绑定表达式语法学习
来源:互联网 发布:知乎日报文章搜索不到 编辑:程序博客网 时间:2024/05/17 22:48
《ASP.NET数据绑定表达式语法 》:
http://msdn2.microsoft.com/zh-cn/library/ms178366(vs.80,d=printer).aspx
1、页面(PAGE)也可以绑定数据,方法是显示调用Page.DataBind()。举例:
Aspx页:
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem>NAME_A</asp:ListItem>
<asp:ListItem>NAME_B</asp:ListItem>
<asp:ListItem>NAME_C</asp:ListItem>
</asp:DropDownList><br />
你选择的是:<%# DropDownList1.SelectedValue %>
<%# 22+11 %>
</div>
</form>
代码页源码:
protected void Page_Load(object sender, EventArgs e)
{
Page.DataBind();
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
Page.DataBind();
}
运行结果显示:
你选择的是:NAME_A 33
ASP.NET可以使用DataBind方法来绑定数据的控件除了DataGrid,Repeater,DataList三个专用的数据绑定控件以外,还有些数据集合性质的Web控件,包括DropDownList,ListBox等,用来指定的数据源一般为数组(ArrayList)、哈稀表(HashTable)、数据表(DataTable)、 数据视图(DataView)和DataReader等。
- ASP.NET数据绑定表达式语法学习
- ASP.NET 数据绑定表达式语法
- ASP.NET数据绑定表达式语法
- ASP。net数据绑定语法
- asp.net数据绑定表达式
- asp.net数据绑定表达式
- ASP.NET数据绑定表达式
- asp.net数据绑定表达式
- asp.net数据绑定表达式
- ASP.NET数据绑定概述和语法
- ASP.NET数据绑定概述和语法
- ASP.NET数据绑定概述和语法
- 学习ASP.NET数据绑定
- ASP.NET中的数据绑定表达式
- ASP.net 绑定表达式
- ASP.NET的数据绑定学习
- ASP.NET 2.0高级数据处理之数据绑定语法
- ASP.NET数据绑定
- IronPython脚本调用C#实现的dll库
- 搞笑视频-石家庄某帅哥视频
- DIV Based Layout with CSS
- 大家帮个忙啊`` 急急急
- 牵着百度爬,让百度来更新自己的站
- ASP.NET数据绑定表达式语法学习
- 开博
- MySQL 常见错误提示的对照表
- 百度收录减少的原因和解决办法
- JAVA中的JTextField 输入框,如何才能把他设置成透明的?
- Issue report and log information.
- vs2005项目模板库不见了[2007-5-21]
- vs.net 2005 出现异常[2005-5-20]
- No Silver Bullet: Essence and Accidents of Software Engineering(摘抄)