简体   繁体   English

从内容页面在用户控件内绑定GridView

[英]Bind gridview inside of usercontrol from content page

嗨,有可能从内容页面绑定到用户控件内的gridview,如果可以的话?

Yes, the easiest way would be to expose the bind in the user control and then call it from your page. 是的,最简单的方法是在用户控件中公开绑定,然后从页面中调用它。

//in user control, add this method
public void BindGrid()
{
    gvInnerGrid.DataBind();
}

//on your page
userControl.BindGrid();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM