用户控制网格绑定 [英] user control grid bind
本文介绍了用户控制网格绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你有一个页面
test.aspx和一个用户控件uc.ascx,用户控件uc.ascx上有一个gridview我如何绑定它的test.aspx页面加载
请帮助
Hi have a page
test.aspx and an user Control uc.ascx, there is a gridview on user control uc.ascx how can i bind it page load of test.aspx
Please help
推荐答案
在test.aspx页面后面的代码中尝试下面的代码。
Hi,
try below code in your code behind of test.aspx page.
GridView grid = (GridView)uc.FindControl("gridview1");
if(grid != null)
{
//bind the gridview object (grid) here.
}
希望它有所帮助。
hope it helps.
这篇关于用户控制网格绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文