UserControl中的Gridview [英] Gridview in UserControl

查看:98
本文介绍了UserControl中的Gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是开发Web应用程序的初学者,所以请帮助我.
我在用户控件中工作时遇到问题.我在用户控件中使用网格视图(仅在用户控件中具有网格视图).我将此用户控件添加到了一个aspx页面中,该页面还具有四个文本框和一个按钮.在文本框中输入数据后单击按钮,则数据正在后面的aspx代码中从数据库中检索,但无法将数据绑定到网格视图.

任何帮助将不胜感激.

谢谢
Anjaneya

Hi,
I am a beginner in developing web application,so please help me.
I got a problem when i am working in user control.I am using Grid View in a user control(only having grid view in usercontrol).I added this usercontrol to an aspx page which also have four text boxes and one button.While clicking button after entering data in textbox, data is retrieving from database in the aspx code behind but unable to bind the data to grid view.

Any help would be appreciated.

Thanks
Anjaneya

推荐答案

将Gridview公开为UserControl的属性.

您可以在父ASPX"页面中访问Usercontrol(ascx)及其可见属性.
在ASPX中获取数据后,使用暴露的属性,将数据绑定到网格.
Expose your Gridview as a property of UserControl.

You can access your Usercontrol(ascx) and its visible properties in Parent ASPX page.
After getting the data in ASPX, use the property exposed, bind the data to the grid.


这篇关于UserControl中的Gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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