为什么我无法在运行时查看我的列表视图 [英] why i can't view my listview on runtime

查看:64
本文介绍了为什么我无法在运行时查看我的列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
           
        }
    }

// Here i used ItemCommand EVENT
// and above code i want to use in page load Event  

    protected void gvUserInfo_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
                
        DataTable dtchildpin = (DataTable)Session["dtchildpin"];
        Label pin = (Label)e.Item.FindControl("lblpin");
        dtchildpin = DAL.Sent_SmartPin.View(pin.Text.ToString());
        gvUserInfo.DataSource = dtchildpin;
        gvUserInfo.DataBind();
    }

推荐答案

你必须在Page_Load事件中分配DataSource并调用DataBind()
You have to assign DataSource and call DataBind() in the Page_Load event


这篇关于为什么我无法在运行时查看我的列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆