>
这是带有中继器的asp文件
<asp:Repeater ID="StudentInfo" runat="server" OnItemCommand="StudentInfo_ItemCommand">
<HeaderTemplate>
<table cellspacing="0" rules="all" border="1">
<tr>
<th scope="col" style="width: 80px">
ID
</th>
<th scope="col" style="width: 120px">
Student ID
</th>
<th scope="col" style="width: 100px">
Student First Name
</th>
<th scope="col" style="width: 100px">
Student Last Name
</th>
<th scope="col" style="width: 100px">
Student Email
</th>
<th scope="col" style="width: 100px">
Added Day
</th>
<th scope="col" style="width: 100px">
Added Month
</th>
<th scope="col" style="width: 100px">
Added year
</th>
<th scope="col" style="width: 100px">
Added period time
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%# Eval("strName") %>
</td>
<td>
<%# Eval("strEmail") %>
</td>
<td>
<%# Eval("strDateAddedTime") %>
</td>
<td>
<asp:Button ID="butDelete" runat="server" Text="Delete" value='<%# DataBinder.Eval(Container.DataItem, "strParkID") %>' /><br />
>
这是C#部分
protected void StudentInfo_ItemCommand(object source, RepeaterCommandEventArgs e)
{
lblTest.Text = e.CommandName.ToString()+"<br/><br/>";
if (e.CommandName == "butDelete")
{
int intParkIDToDelete = Convert.ToInt32(e.CommandArgument);
funDeleteUser(intParkIDToDelete);
}
//if (e.CommandSource == ("Edit Person"))
//{
// int intParkIDToDelete = Convert.ToInt32(e.CommandArgument);
// //funEditUser(intParkIDToDelete);
//}
}