asp.net 向数据表添加控件

本文关键字:添加 控件 数据表 net asp | 更新日期: 2023-09-27 17:55:35

是否可以在 asp.net C# 中的数据表中添加用户控件?以下代码生成此代码:System.Web.UI.WebControls.TextBox,而不是输入

    dr[0] = new TextBox (); // where dr is a dataRow and the datatable is 
                            // bound to a datagrid in the user control

asp.net 向数据表添加控件

据我所知,datatable 可以保留任何数据(在您的情况下可能是字符串格式)并提供输出。但这并不意味着它会在输出中显示控件而不是文本框。要在输出中显示文本框,还有其他方法。