Sitecore 6.4:我可以通过编程方式将ASP.NET HtmlGenericControl添加到Items Sublayout吗?

时间:2014-09-11 06:51:30

标签: asp.net sitecore

我以编程方式更新项目。我有一个返回HtmlGenericControl的方法。我想以编程方式将此HtmlGenericControl放入项目的子布局中。 这可能吗?

1 个答案:

答案 0 :(得分:0)

我认为你的意思是:

// This is where your method returns the control.
HtmlGenericControl htmlControl = GetControl(); 

// This is how you add it as a child control of a placeholder
myPlaceHolder.Controls.Add(htmlControl);