Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 如何在DataList中使用数据绑定事件_Asp.net - Fatal编程技术网

Asp.net 如何在DataList中使用数据绑定事件

Asp.net 如何在DataList中使用数据绑定事件,asp.net,Asp.net,我正在使用DataList,希望通过数据绑定事件绑定数据。 当我尝试使用ItemDatBind事件绑定数据时,比它的给定错误大;当我使用断点时,比它第一次转到datBinding事件时,比它的源代码大;当它转到源代码时,它的给定错误是“System.data.DataRowView”不包含名为“iParentPageId_PK”的属性 那么我现在做什么 这是我的密码 protected void dlRight_ItemDataBound(object sender, DataListItemE

我正在使用DataList,希望通过数据绑定事件绑定数据。 当我尝试使用ItemDatBind事件绑定数据时,比它的给定错误大;当我使用断点时,比它第一次转到datBinding事件时,比它的源代码大;当它转到源代码时,它的给定错误是“System.data.DataRowView”不包含名为“iParentPageId_PK”的属性 那么我现在做什么

这是我的密码

protected void dlRight_ItemDataBound(object sender, DataListItemEventArgs e)
{
    if (e.Item.ItemType == ListItemType.Item)
    {
        Label lblId = (Label)e.Item.FindControl("lblId");
        SubPage objEntity = new SubPage()
        {

            ParentPageId = Convert.ToInt32(lblId.Text)

        };
        dlRight.DataSource = objSubBll.GetByParentPageId(objEntity);
        dlRight.DataBind();
    }
}
protected void dlRight_DataBinding(object sender, EventArgs e)
{

}

看起来您正在访问ASXP页面中的iParentPageId_PK,但数据源中没有名为iParentPageId_PK的列。@Win:-没有,先生,它有……请给我们显示ASPX页面。@Win:-它是我的表格内容……选择前1000名[iParentPageId_PK]、[sTitle]、[Scocontent]、[sUrl]、[Smetittle]、[SmetDescription],[dbCMS].[dbo].[tbParentPage]中的[sMetaKeyword]、[iLocation]、[iShowon]、[bIsActive]