okay?
I have a button that is inside an updatepanel, click on this button I’m trying to load an updatepanel updatepanel and inside this I have a usercontrol added. This is done dynamically’m not having success.
Could anyone help me?
Protected Sub btnNewRpt_Click(sender As Object, e As EventArgs) Handles btnNewRpt.Click
Dim hydic As New HybridDictionary From {{"tabId", "tab1"},
{"ucPath", "UCRelatorioNovo.ascx"},
{"ucId", "uc1"}}
buildControls(hydic)
End Sub
Private Sub buildControls(ByVal hydic As HybridDictionary)
Dim uc As UserControl = LoadControl(hydic("ucPath"))
uc.ID = hydic("ucId")
Dim tg As New PostBackTrigger With {.ControlID = uc.FindControl("btnLoadOtherUC").UniqueID}
Dim up As New UpdatePanel With {.ID = "upTest"}
up.ContentTemplateContainer.Controls.Add(uc)
up.Triggers.Add(tg)
Dim tp As New TabPanel With {.ID = hydic("tabId")}
tp.Controls.Add(up)
TabContainer1.Controls.Add(tp)
End Sub
the error description is: Could not find UpdatePanel with ID ‘TabContainer1_tab1_upTest’. If it is being wellness updated dynamically then it must be inside another UpdatePanel.
Instead of placing UpdatePanel upTest inside TabContainer’s TabPanel, place TabContainer/TabPanel inside upTest if you want to update them besides updating your custom control else you can place only the custom control inside upTest.