using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; namespace Estore { public class ProductDetails : WebBlocksControl { public void BindData(SelectorData SelectorData) { SelectorControl sc = null; switch (SelectorData.SelectorType) { case "List": sc = (SelectorControl)Page.LoadControl("~/Controls/Selectors/List.ascx"); break; case "Dropdown": sc = (SelectorControl)Page.LoadControl("~/Controls/Selectors/DropdownSelect.ascx"); break; case "SingleItem": sc = (SelectorControl)Page.LoadControl("~/Controls/Selectors/SingleItem.ascx"); break; default: sc = (SelectorControl)Page.LoadControl("~/Controls/Selectors/List.ascx"); break; } sc.SelectorData = SelectorData; Controls.Add(sc); sc.BindData(); } } }