Hi Folks,
I am facing following problem, please let me know even if you have some clue on how to solve it.
I am adding a usercontrol of custom type to tabpanel (child control ofAjaxControlToolkit.TabContainer type) with following code -
aTabCtl.ActiveTab.Controls.AddAt(0, LoadControl(sCurrentControl.ToString()))
'aTabCtl is declared and initialised somewhere else
Dim lTUC As VMS_TabUserControl
'old lTUC = CType(aTabCtl.SelectedTabObject.ContentPane.UserControl, VMS_TabUserControl)
lTUC = CType(aTabCtl.ActiveTab.Controls(0), VMSDotNet.VMS_TabUserControl)
immediately after adding I am retrieving the custom control using following code, it is doing fine so far -
Dim lTUC As VMS_TabUserControl
lTUC = CType(aTabCtl.ActiveTab.Controls(0), VMSDotNet.VMS_TabUserControl)
VMSDotNet.VMS_TabUserControl is type of usercontrol.
here is the problem part - when I do the postback and try to retrive the tab using following code -
CType(_uwtBase.ActiveTab.Controls(0), VMSDotNet.VMS_TabUserControl)
it returns me the control of type System.web.ui.control, I don't know why and it throws me an error saying it can't convert from type System.web.ui.control to VMSDotNet.VMS_TabUserControl. I am not able to get it why it is changing the type of user control to System.web.ui.control from VMSDotNet.VMS_TabUserControl after postback.
Please let me know with your great ideas what can be the cause behind this problem.
Thanks,
Mandeep.
Property Search. Search FREE! on MSN Real Estate for all your property needs
Share photos while you chat with Windows Live Messenger.