我想动态呈现用户控件,但我的代码没有按预期工作。代码隐藏不会被执行。这是我的渲染代码:
Dim ucControl As UserControl = LoadControl(pControl.VirtualPath & "/" & Control & ".ascx")
Dim ucSB As New StringBuilder
Dim ucSW As New StringWriter(ucSB)
Dim ucHTML As New HtmlTextWriter(ucSW)
ucControl.RenderControl(ucHTML)
谢谢您的帮助!