将Web控件插入动态创建的表中,此处如何使用嵌套表 [英] inserting web controls in a table which dynamically created, here how can use the nested table

查看:114
本文介绍了将Web控件插入动态创建的表中,此处如何使用嵌套表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里,我该如何在主表的表单元格中插入webcontrol表

here how can i insert the webcontrol table with in a tablecell of Main table

推荐答案

尝试为目标单元格提供ID(例如
try to give the target cell an ID (for example
ID=TargetCell

)并设置

runat="server"

的属性.

然后将用户控件加载到其中:

in its attributes.

then load the user control into it :

TargetCell.Controls.Add(Page.LoadControl("usercontrol1.ascx"));


您需要制作
之后,在后面的代码中,您将必须访问此tr,然后将HTMLCell添加到此控件中

you need to make
after this in code behind you will have to access this tr and then add HTMLCell into this control
i.e
Dim cell as new HTMLTableCell


在此之后,我认为工作对您来说很清楚.
立即创建表,将控件插入到表中,并将表插入到刚创建的单元格中.


after this i think work gonna be clear to you.
just create table now, insert control into the table and table into the cell you just created.
i.e

dim ctrl as MyControl
dim tbl as new HTMLTable
tbl.controls.add(ctrl)
cell.controls.add(tbl)



希望这会对您有所帮助:)



Hope this will help you :)


这篇关于将Web控件插入动态创建的表中,此处如何使用嵌套表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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