日期:2014-05-17 浏览次数:20473 次
public partial class LwManage : System.Web.UI.Page
{
CommonClass CC = new CommonClass();//公共类实例CC
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
lvdatabind();//绑定数据
}
}
protected void lvdatabind()
{
int totalCount =Convert.ToInt32(new T_LeaveWordTableAdapter().QueryCount());
DataSet data = CC.GetPagedata("id,title,leavecontent,ltime,author,rcontent,retime,province,city","ltime","T_LeaveWord",AspNetPager1,totalCount);
ListView1.DataSource = data;
ListView1.DataBind();
}
protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
ListViewDataItem lvdataitem = (ListViewDataItem)e.Item;
DataRowView rowview = (DataRowView)lvdataitem.DataItem;
我这里取出当前绑定行的某一列数据怎么处理?比如字段“id”的值,我想通过“id”的值来判断,然后再操作。谢谢!
}
}