All pastes #505596 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-05-23 17:29 UTC
rendered paste body
if (!this.IsPostBack)
        {
            System.Reflection.Assembly objAssembly = System.Reflection.Assembly.LoadFile(HttpRuntime.BinDirectory + "YopsControlLibrary.dll");
            foreach (Type objType in objAssembly.GetTypes())
            {
                if (objType.BaseType == typeof(System.Web.UI.UserControl))
                {
                    Telerik.WebControls.RadMenuItem objItem = new Telerik.WebControls.RadMenuItem(objType.FullName);
                    objItem.NavigateUrl = "Default.aspx?Control=Plugins/YopsControlLibrary.dll/" + objType.FullName + ".ascx";
                    this.RadMenu1.Items.Add(objItem);
                }
            }
        }
        if (this.Request.QueryString["Control"] != null)
        {
            Control ctrl = LoadControl(this.Request.QueryString["Control"].ToString());
            this.pnlcontent.Controls.Add(ctrl);
        }