日期:2014-05-16 浏览次数:20963 次
<%@ Page Language="C#" EnableViewState="true" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
public System.Data.DataTable GetData()
{
System.Data.DataTable dataTable1 = new System.Data.DataTable("BlogUser");
dataTable1.Columns.Add(new System.Data.DataColumn("UserId", typeof(System.Int32)));
dataTable1.Columns.Add(new System.Data.DataColumn("Title", typeof(System.String)));
for (int i = 0; i < 8; i++)
{
dataTable1.Rows.Add(i, "测试" + i.ToString());
}
return dataTable1;
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GridViewBind();
}
}
protected void GridViewCar_RowDataBound(object sender, GridViewRowEventArgs e)
{
}
// 待命
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
//currentRow.Cells[3].Text = SateToPicPerson(p.State);
//得到所选中的
foreach (GridViewRow row in GridViewCar.Rows)
{
CheckBox chkSelect = row.FindControl("chkSelect") as CheckBox;
if (chkSelect.Checked)
{
Response.Write("<li>选中的 userId = " + GridViewCar.DataKeys[row.RowIndex].Value.ToString());
}
}
GridViewBind();
}
// 下岗
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
//得到所选中的
foreach (GridViewRow row in GridViewCar.Rows)
{
CheckBox chkSelect = row.FindControl("chkSelect") as CheckBox;
if (chkSelect.Checked)
{
Response.Write("<li>选中的 userId = " + GridViewCar.DataKeys[row.RowIndex].Value.ToString());
&