測試環境:SDK
建立測試工程
新建頁面
HTML頁面
<%@ Page Language=
<!DOCTYPE html PUBLIC
<html xmlns=
<head runat=
<title>使用Web控件</title>
</head>
<body>
<form id=
<div>
<asp:Repeater ID=
<ItemTemplate>
<%#Eval(
</ItemTemplate>
</asp:Repeater>
</div>
</form>
<%=(System
</body>
</html>
CS文件:
protected int ts;
protected void Page_Load(object sender
{
ts = Environment
string connstring = System
SqlConnection myconn = new SqlConnection(connstring);
SqlCommand cmd = new SqlCommand(
myconn
SqlDataReader dr = cmd
Repeater
Repeater
dr
dr
myconn
myconn
}
按F
新建頁面
HTML代碼:
<%@ Page Language=
<!DOCTYPE html PUBLIC
<html xmlns=
<head runat=
<title>不使用Web控件</title>
</head>
<body>
<form id=
<div>
<%while (dr
<%=dr[
<% } %>
</div>
</form>
<%
dr
dr
myconn
myconn
%>
<%=(System
</body>
</html>
CS代碼
protected int ts;
protected SqlConnection myconn;
protected SqlDataReader dr;
protected void Page_Load(object sender
{
ts = Environment
string connstring = System
myconn = new SqlConnection(connstring);
SqlCommand cmd = new SqlCommand(
myconn
dr = cmd
}
F
下面截圖是多次測試的數據比較
Default
從上圖我們可以看到default
總結
有人會說default
From:http://tw.wingwit.com/Article/program/net/201311/13331.html