Repeater控件为什么啥也不显示呢
沒有执行.aspx代码,应该是执行完Repeater1.DataBind();后再执行aspx文件中Eval那里才对啊,为什么直接就执行con.Close();
.aspx代码:
<%@ Page Language= "C# " AutoEventWireup= "true " CodeFile= "Default.aspx.cs " Inherits= "_Default " %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml " >
<head runat= "server ">
<title> 无标题页 </title>
</head>
<body>
<form id= "form1 " runat= "server ">
<div>
<asp:Repeater ID= "Repeater1 " runat= "server ">
<asp:HeaderTemplate>
<table>
<tr>
<td>
编号 </td>
<td>
身份证号码 </td>
<td>
姓名 </td>
</tr>
</asp:HeaderTemplate>
<asp:ItemTemplate>
<tr>
<td>
<asp:Label runat= "server " ID= "bianhao " Text= ' <%# Eval( "员工编号 ") %> '/>
</td>
<td>
<asp:Label runat= "server " ID= "shenfenzheng " Text= ' <%# Eval( "身份证号码 ") %> '/>
</td>
<td>
<asp:Label runat= "server " ID= "xingming " Text= ' <%# Eval( "学生姓名 ") %> '/>