Skip to main content

Posts

Showing posts from July, 2012

.NET Mathematics

Loading UserControl on another UserControl & assigning Properties of loaded UserControl
Parent UserControl (.ascx) UI:

<%@ControlLanguage="C#"AutoEventWireup="true"CodeBehind="MultiVarientModule.ascx.cs" Inherits="Modules.MultiVarientModule"%> <divid="parent"runat="server"> </div>

Parent UserControl Code File (.cs) :

#region CONSTANTS conststring CAROUSAL = "~/Modules/Carousal.ascx"; conststring THREECOLUMNS = "~/Modules/ThreeColumn.ascx"; conststring REGULAR = "~/Modules/Regular.ascx"; #endregion protectedvoid Page_Load(object sender, EventArgs e) { switch(ControlName) {        case"Carousel":               parent.Controls.Add(LoadControl(CAROUSAL));               break;        case"ThreeColumn":               parent.Controls.Add(LoadControl(THREECOLUMNS));               break;        case"Regular":               {               Regular reg = (Regular)LoadControl(R…