【整理】动态加载Web UserControl
protected override void OnLoad(EventArgs e)
{
HttpCookie login_cookie = Request.Cookies["login_cookie"];
if (login_cookie != null && MyDAL.MyUtility.IsInArray("ucid", Request.QueryString.AllKeys))
{
string ucid = Request.QueryString["ucid"];
string UCID = string.Format(@"~/uc/{0}.ascx", ucid.Replace('.', '/'));
if (System.IO.File.Exists(Server.MapPath(UCID)))
{
UserControl uc = (UserControl)Page.LoadControl(UCID);
uc.ID = "uc";
PH_Holder.Controls.Add(uc);
}
}
base.OnLoad(e);
}