In the below method when the execution came to tbData.RenderControl(textWriter) method ,then it is giving an error as "Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request."
Dim sb As New StringBuilder
Dim tbData As New HtmlTable
Dim Row As New HtmlTableRow
Dim add_img_popup As New RadButton()
add_img_popup.Text = "Add new Image"
' click event handler
add_img_popup.Enabled = True
add_img_popup.ID = "btn_add_img_popup"
' programmatic id
' Page.Controls.Add(add_img_popup)
Dim CellTopicID As New HtmlTableCell
CellTopicID.Style.Add("font-family", "Arial")
CellTopicID.Style.Add("font-size", "10pt")
CellTopicID.VAlign = "Top"
CellTopicID.Align = "Left"
CellTopicID.NoWrap = False
CellTopicID.Controls.Add(add_img_popup)
Row.Cells.Add(CellTopicID)
Dim CellDateNotified As New HtmlTableCell
CellDateNotified.InnerText = "Hello"
CellDateNotified.Style.Add("font-family", "Arial")
CellDateNotified.Style.Add("font-size", "10pt")
CellDateNotified.VAlign = "Top"
CellDateNotified.Align = "Left"
CellDateNotified.NoWrap = True
Row.Cells.Add(CellDateNotified)
tbData.Rows.Add(Row)
Dim stringBuilder As New StringBuilder()
Dim stringWriter As New StringWriter(stringBuilder)
Dim textWriter As New HtmlTextWriter(stringWriter)
tbData.RenderControl(textWriter)
Dim sb As New StringBuilder
Dim tbData As New HtmlTable
Dim Row As New HtmlTableRow
Dim add_img_popup As New RadButton()
add_img_popup.Text = "Add new Image"
' click event handler
add_img_popup.Enabled = True
add_img_popup.ID = "btn_add_img_popup"
' programmatic id
' Page.Controls.Add(add_img_popup)
Dim CellTopicID As New HtmlTableCell
CellTopicID.Style.Add("font-family", "Arial")
CellTopicID.Style.Add("font-size", "10pt")
CellTopicID.VAlign = "Top"
CellTopicID.Align = "Left"
CellTopicID.NoWrap = False
CellTopicID.Controls.Add(add_img_popup)
Row.Cells.Add(CellTopicID)
Dim CellDateNotified As New HtmlTableCell
CellDateNotified.InnerText = "Hello"
CellDateNotified.Style.Add("font-family", "Arial")
CellDateNotified.Style.Add("font-size", "10pt")
CellDateNotified.VAlign = "Top"
CellDateNotified.Align = "Left"
CellDateNotified.NoWrap = True
Row.Cells.Add(CellDateNotified)
tbData.Rows.Add(Row)
Dim stringBuilder As New StringBuilder()
Dim stringWriter As New StringWriter(stringBuilder)
Dim textWriter As New HtmlTextWriter(stringWriter)
tbData.RenderControl(textWriter)