网上有好几种解释,但我觉得都是元数据的解释。有人说应该理解成“从--元数据”来。
这里有一个例子。
这个有[从元数据]的标志,上面还带了一个锁一样的图标using ASP;
using System;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;namespace MB.TheBeerHouse.UI
{
    public class TemplateMaster : MasterPage
    {
        protected AppearanceEditorPart AppearanceEditorPart1;
        protected BehaviorEditorPart BehaviorEditorPart1;
        protected CatalogZone CatalogZone1;
        protected WebPartZone CenterZoneBottom;
        protected WebPartZone CenterZoneBottomLeft;
        protected WebPartZone CenterZoneBottomRight;
        protected WebPartZone CenterZoneTop;
        protected WebPartZone CenterZoneTopLeft;
        protected WebPartZone CenterZoneTopRight;
        protected DeclarativeCatalogPart DeclarativeCatalogPart1;
        protected EditorZone EditorZone1;
        protected LayoutEditorPart LayoutEditorPart1;
        protected ContentPlaceHolder LeftContent;
        protected WebPartZone LeftZoneBottom;
        protected WebPartZone LeftZoneTop;
        protected Localize locTemplateMonster1;
        protected Localize locTemplateMonster2;
        protected LoginView LoginView1;
        protected HtmlForm Main;
        protected ContentPlaceHolder MainContent;
        protected Menu mnuFooter;
        protected Menu mnuHeader;
        protected ASP.controls_newsletterbox_ascx NewsletterBox1;
        protected PageCatalogPart PageCatalogPart1;
        protected ASP.controls_personalizationmanager_ascx PersonalizationManager1;
        protected ASP.controls_pollbox_ascx PollBox1;
        protected ASP.controls_pollbox_ascx pollCurrent;
        protected PropertyGridEditorPart PropertyGridEditorPart1;
        protected ContentPlaceHolder RightContent;
        protected WebPartZone RightZoneBottom;
        protected WebPartZone RightZoneTop;
        protected ASP.controls_shoppingcartbox_ascx ShoppingcartBox1;
        protected SiteMapDataSource SiteMapDataSource1;
        protected SiteMapPath SiteMapPath1;
        protected Image TemplateMonsterBanner;
        protected ASP.controls_themeselector_ascx ThemeSelector1;        public TemplateMaster();        protected global_asax ApplicationInstance { get; }
        public bool EnablePersonalization { get; set; }        protected ProfileCommon Profile { get; }        protected void Page_Load(object sender, EventArgs e);
    }
}
这个是普通的文件using System;
using System.Data;
using System.Configuration;
using System.Collections;
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 MB.TheBeerHouse.UI
{
   public partial class TemplateMaster : System.Web.UI.MasterPage
   {
      private bool _enablePersonalization = false;
      public bool EnablePersonalization      {
         get { return _enablePersonalization; }
         set
         {
            _enablePersonalization = value;
            PersonalizationManager1.Visible = (this.Page.User.Identity.IsAuthenticated && value);
         }
      }      protected void Page_Load(object sender, EventArgs e)
      {
         if (!this.Page.User.Identity.IsAuthenticated)
            PersonalizationManager1.Visible = false;
      }
   }
}

解决方案 »

  1.   

    没标示好,重写关键的两句using ASP;
    using System;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;namespace MB.TheBeerHouse.UI
    {
        public class TemplateMaster : MasterPage
        {
            protected AppearanceEditorPart AppearanceEditorPart1;
            protected BehaviorEditorPart BehaviorEditorPart1;
            protected CatalogZone CatalogZone1;
            protected WebPartZone CenterZoneBottom;
            protected WebPartZone CenterZoneBottomLeft;
            protected WebPartZone CenterZoneBottomRight;
            protected WebPartZone CenterZoneTop;
            protected WebPartZone CenterZoneTopLeft;
            protected WebPartZone CenterZoneTopRight;
            protected DeclarativeCatalogPart DeclarativeCatalogPart1;
            protected EditorZone EditorZone1;
            protected LayoutEditorPart LayoutEditorPart1;
            protected ContentPlaceHolder LeftContent;
            protected WebPartZone LeftZoneBottom;
            protected WebPartZone LeftZoneTop;
            protected Localize locTemplateMonster1;
            protected Localize locTemplateMonster2;
            protected LoginView LoginView1;
            protected HtmlForm Main;
            protected ContentPlaceHolder MainContent;
            protected Menu mnuFooter;
            protected Menu mnuHeader;
            protected ASP.controls_newsletterbox_ascx NewsletterBox1;
            protected PageCatalogPart PageCatalogPart1;
            protected ASP.controls_personalizationmanager_ascx PersonalizationManager1;
            protected ASP.controls_pollbox_ascx PollBox1;
            protected ASP.controls_pollbox_ascx pollCurrent;
            protected PropertyGridEditorPart PropertyGridEditorPart1;
            protected ContentPlaceHolder RightContent;
            protected WebPartZone RightZoneBottom;
            protected WebPartZone RightZoneTop;
            protected ASP.controls_shoppingcartbox_ascx ShoppingcartBox1;
            protected SiteMapDataSource SiteMapDataSource1;
            protected SiteMapPath SiteMapPath1;
            protected Image TemplateMonsterBanner;
            protected ASP.controls_themeselector_ascx ThemeSelector1;        public TemplateMaster();        protected global_asax ApplicationInstance { get; }
            public bool EnablePersonalization { get; set; }   //就是它,很简单的一句,注意对应下面的看
            protected ProfileCommon Profile { get; }        protected void Page_Load(object sender, EventArgs e);
        }
    }
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    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 MB.TheBeerHouse.UI
    {
       public partial class TemplateMaster : System.Web.UI.MasterPage
       {
          private bool _enablePersonalization = false;
          public bool EnablePersonalization  //就是这个属性了,下面写得很全
          {
             get { return _enablePersonalization; }
             set
             {
                _enablePersonalization = value;
                PersonalizationManager1.Visible = (this.Page.User.Identity.IsAuthenticated && value);
             }
          }      protected void Page_Load(object sender, EventArgs e)
          {
             if (!this.Page.User.Identity.IsAuthenticated)
                PersonalizationManager1.Visible = false;
          }
       }
    }