zoukankan
html css js c++ java
Asp.Net2.0数据绑定之XmlDataSource控件
XML文件
:
<?
xml version="1.0" encoding="gb2312"
?>
<?
xml-stylesheet type="text/xsl" href="XSLTemplate.xsl"
?>
<
Books
>
<
BookItem
>
<
BookName
>
Coding With C#
</
BookName
>
<
Author
>
darkhorse
</
Author
>
<
Price
>
20
</
Price
>
</
BookItem
>
<
BookItem
>
<
BookName
>
Coding With VB
</
BookName
>
<
Author
>
Cherry
</
Author
>
<
Price
>
25
</
Price
>
</
BookItem
>
<
BookItem
>
<
BookName
>
Coding With Java
</
BookName
>
<
Author
>
LiuDong
</
Author
>
<
Price
>
30
</
Price
>
</
BookItem
>
<
BookItem
>
<
BookName
>
Coding With JavaScript
</
BookName
>
<
Author
>
DongSheng
</
Author
>
<
Price
>
35
</
Price
>
</
BookItem
>
</
Books
>
Asp.Net页面文件
:
<%
@ Page Language
=
"
C#
"
%>
<!
DOCTYPE html PUBLIC
"
-//W3C//DTD XHTML 1.0 Transitional//EN
"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
"
>
<
script runat
=
"
server
"
>
</
script
>
<
html xmlns
=
"
http://www.w3.org/1999/xhtml
"
>
<
head runat
=
"
server
"
>
<
title
>
Asp.Net2.0中的数据绑定
</
title
>
</
head
>
<
body
>
<
form id
=
"
form1
"
runat
=
"
server
"
>
<
div
>
&
nbsp;
&
nbsp;
<
asp:XmlDataSource ID
=
"
XmlDataSource1
"
runat
=
"
server
"
DataFile
=
"
~/App_Data/BookXML.xml
"
XPath
=
"
Books/BookItem
"
></
asp:XmlDataSource
>
<
asp:GridView ID
=
"
GridView1
"
runat
=
"
server
"
DataSourceID
=
"
XmlDataSource1
"
AutoGenerateColumns
=
"
False
"
BackColor
=
"
White
"
BorderColor
=
"
#E7E7FF
"
BorderStyle
=
"
None
"
BorderWidth
=
"
1px
"
CellPadding
=
"
3
"
GridLines
=
"
Horizontal
"
>
<
Columns
>
<
asp:TemplateField HeaderText
=
"
书名
"
>
<
ItemTemplate
>
<%
# XPath(
"
BookName
"
)
%>
</
ItemTemplate
>
</
asp:TemplateField
>
<
asp:TemplateField HeaderText
=
"
作者
"
>
<
ItemTemplate
>
<%
# XPath(
"
Author
"
)
%>
</
ItemTemplate
>
</
asp:TemplateField
>
<
asp:TemplateField HeaderText
=
"
价格
"
>
<
ItemTemplate
>
<%
# XPath(
"
Price
"
)
%>
</
ItemTemplate
>
</
asp:TemplateField
>
</
Columns
>
<
FooterStyle BackColor
=
"
#B5C7DE
"
ForeColor
=
"
#4A3C8C
"
/>
<
RowStyle BackColor
=
"
#E7E7FF
"
ForeColor
=
"
#4A3C8C
"
/>
<
SelectedRowStyle BackColor
=
"
#738A9C
"
Font
-
Bold
=
"
True
"
ForeColor
=
"
#F7F7F7
"
/>
<
PagerStyle BackColor
=
"
#E7E7FF
"
ForeColor
=
"
#4A3C8C
"
HorizontalAlign
=
"
Right
"
/>
<
HeaderStyle BackColor
=
"
#4A3C8C
"
Font
-
Bold
=
"
True
"
ForeColor
=
"
#F7F7F7
"
/>
<
AlternatingRowStyle BackColor
=
"
#F7F7F7
"
/>
</
asp:GridView
>
</
div
>
</
form
>
</
body
>
</
html
>
查看全文
相关阅读:
poj 3264 Balanced Lineup(st/线段树)
Linux下的硬件驱动——USB设备(下)
linux-2.6.14下USB驱动移植心得
Linux下的硬件驱动——USB设备(上)
在menuconfig中配置Linux内核裁剪的具体步骤
Linux-2.6.32.2内核在mini2440上的移植(十)---配置USB外设
ubuntu12.04下NFS安装
make menuconfig时提示“error opening terminal”的解决方法
linux系统日志编程
socat用法
原文地址:https://www.cnblogs.com/darkhorse/p/815643.html
最新文章
HDU4258_Covered Walkway
UVA11737_Extreme Primitive Society
UVA11736_Debugging RAM
UVA11735_Corner the Queens
UVA11734_Big Number of Teams will Solve This
HDU2993_MAX Average Problem
CCPC-Wannafly Winter Camp Day3 (Div2, onsite) I 石头剪刀布(按秩合并并查集)
原 CCPC-Wannafly Winter Camp Day7 Div2 A-迷宫(思维)
D
Longest Common Substring(后缀自动机)
热门文章
CCPC-Wannafly Winter Camp Day1 F 爬爬爬山(最短路+思维)
后缀自动机二·重复旋律5
后缀自动机三·重复旋律6
Kirill the Gardener 3 URAL
codeforce 1070 E. Getting Deals Done
CF1070 C. Cloud Computing (线段树)
HDU 4614 Vases and Flowers (二分+线段树)
HDU4578 Transformation(线段树)
HDU 1540 Tunnel Warfare(线段树维护最大连续区间长度)
HDU 4027 Can you answer these queries?(线段树+优化)
Copyright © 2011-2022 走看看