I cannot figure out how to add a placeholder dynamically. Here is the code I am using. It does not recognize the placeholder.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Dim Chart As New Chart
Chart.ID = "Chart" & MyTerrCode
Dim Placeholder As New PlaceHolder
Placeholder.ID = "Placeholder" & MyTerrCode
PlaceHolder.Controls.Add(Chart)
PlaceHolder.Controls.Add(New LiteralControl("<br><br>"))
End If
End Sub
Here is what I missed. I need to add the placeholder to the the page. this.Form.Controls.Add(PlaceHolder)