I need to dynamically add some controlls to a web user control.
I'm putting all the controlls to a Table control and adding to the page as follows at the RenderControl event.
When I adding simple ASP controls to this outer table, it is working fine.
But when I add Telerik Controls gives following error when it execute "panel.RenderControl(writer)" code.
Error:
Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.
I'm using a Master page also.
Can u help me?
I'm putting all the controlls to a Table control and adding to the page as follows at the RenderControl event.
Public Overrides Sub RenderControl(ByVal writer As System.Web.UI.HtmlTextWriter)
Dim panel As New Panel
Dim outerTable As New Table
outerTable = generateDynamicControls()
panel.Controls.Add(outerTable)
panel.RenderControl(writer)
MyBase.RenderControl(writer)
End Sub
When I adding simple ASP controls to this outer table, it is working fine.
But when I add Telerik Controls gives following error when it execute "panel.RenderControl(writer)" code.
Error:
Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.
I'm using a Master page also.
Can u help me?