动态加载控件:动态加载服务器控件来源: 发布时间:星期四, 2009年2月12日 浏览:186次 评论:0
代码举例1: dlist = New ![]() ![]() dlist.Items.Clear ![]() dlist.ID = \"d\" & rs2.Fields(\"zdm\").Value Do While Not rs3.EOF dlist.Items.Add(rs3.Fields(0).Value) rs3.MoveNext ![]() Loop td2.Controls.Add(dlist) 代码举例2: TextBox textbox = ![]() ![]() textbox.ID = showReader.GetValue(0). ![]() ![]() this.Controls.Add(textbox); 代码举例3: // Override to create repeated items. protected override void CreateChildControls ![]() object o = ViewState[\"NumItems\"]; ![]() // Clear any existing child controls. Controls.Clear ![]() ![]() ![]() for ( ![]() ![]() // Create an item. RepeaterItem item = ![]() // Initialize the item from the template. ItemTemplate.InstantiateIn(item); // Add the item to the ControlCollection. Controls.Add(item); } } } 备注 新Control控件添加到序号索引 ![]() ![]() ![]() ![]() ![]() ![]() 若要将Control控件添加到集合中 ![]() ![]() ![]() 0
相关文章
读者评论发表评论 |