在更新面板中添加动态控件然后无法加载视图错误?
参见以下示例: -
UpdatePanel面板= new UpdatePanel();
panel.ContentTemplateContainer.Controls.Clear(); if(strPopupType ==“O”) { Control ctrl = Page.LoadControl(@“〜/ Modules / MLM / UnilevelViewer / DesktopModules / OrderDetails.ascx”);
OrderDetails orderdetails = (OrderDetails)ctrl;
orderdetails.ID = "Orders" + elementID;
orderdetails.OrderID = Convert.ToInt32(elementID);
//orderdetails.ModuleSkinStyleName = CurrentModuleSkin;
panel.ContentTemplateContainer.Controls.Add(ctrl);
}
else if (strPopupType == "U")
{
Control ctrl = Page.LoadControl(@"~/Modules/MLM/UnilevelViewer/DesktopModules/UserDetails.ascx");
UserDetails userdetails = (UserDetails)ctrl;
userdetails.ID = "Users" + elementID;
// userdetails.UserModuleSkinStyleName = CurrentModuleSkin;
userdetails.UserID = new Guid(elementID);
panel.ContentTemplateContainer.Controls.Add(ctrl);
}