如何在aspx页面的用户控件的gridview中插入数据。 [英] How to Insert data in gridview of User control from aspx page.

查看:94
本文介绍了如何在aspx页面的用户控件的gridview中插入数据。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


我有一个要求,比如我在usercontrol中有一个gridivew,而这个用户控件放在aspx页面(比如a.aspx),当我输入一些数据时a.aspx页面,数据必须显示在usercontrol的gridview上,我在调用填充gridview的usercontrol方法时非常成功,但是数据没有绑定。



Eg代码



in aspx



usercontrol1.binddata(数据)

<用户控件中的




binddata(数据集数据)

{

Gridview1.datasource = data;

Gridview1.databind();



}

hi
I have a requirement like i have a gridivew in usercontrol, and this user control in placed in aspx page( say a.aspx), when i enter some data in a.aspx page that data must be displayed on gridview of usercontrol, i was sucessfull in calling the usercontrol method that fill the gridview, but data is not binding.

Eg Code

in aspx

usercontrol1.binddata( Data)

in usercontrol

binddata(dataset data)
{
Gridview1.datasource=data;
Gridview1.databind();

}

推荐答案

在网格中插入数据时再次绑定用户控件............

或刷新页面
bind the user control again when you insertdata in grid............
or refresh the page


这篇关于如何在aspx页面的用户控件的gridview中插入数据。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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