當前位置: 首頁>>代碼示例>>C#>>正文


C# HtmlControls.HtmlMeta類代碼示例

本文整理匯總了C#中System.Web.UI.HtmlControls.HtmlMeta的典型用法代碼示例。如果您正苦於以下問題:C# HtmlMeta類的具體用法?C# HtmlMeta怎麽用?C# HtmlMeta使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HtmlMeta類屬於System.Web.UI.HtmlControls命名空間,在下文中一共展示了HtmlMeta類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: lbkUnDisable_Click

 protected void lbkUnDisable_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(ddlUsers.SelectedValue))
     {
         if (Membership.GetUser(ddlUsers.SelectedValue).IsApproved == false)
         {
             MembershipUser user = Membership.GetUser(ddlUsers.SelectedValue);
             user.IsApproved = true;
             Membership.UpdateUser(user);
             if (Membership.GetUser(ddlUsers.SelectedValue).IsApproved == true)
             {
                 HtmlMeta meta = new HtmlMeta();
                 meta.HttpEquiv = "Refresh";
                 meta.Content = "2;url=ManageUser.aspx";
                 this.Page.Controls.Add(meta);                        
                 lblComment.Text = "<h4 style='color:green'>User " + ddlUsers.SelectedItem.Text + "'s account is now Undisabled</h4><br/><br/>You will now be redirected in 5 seconds";
             }
         }
         else
         {
             lblComment.Text = "<h4 style='color:green'>User " + ddlUsers.SelectedItem.Text + "'s account is not Disabled.</h4>";
         }
     }
     else
     {
         lblComment.Text = "<h4 style='color:red'>Please Select a User to Undisable</h4>";
     }
 }
開發者ID:saltmktg,項目名稱:isbepi.erikson.edu,代碼行數:28,代碼來源:DisableUser.aspx.cs

示例2: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     User loggedUser = UserOpr.isLogged(Request);
     if (loggedUser == null)
     {
         LoginStatus.Text = "您未登錄或登錄過期,請重新登錄,3秒後跳轉到用戶登錄頁麵";
         LoginStatus.Visible = true;
         HtmlMeta RedirectMeta = new HtmlMeta(); //重定向用Meta標簽
         RedirectMeta.HttpEquiv = "refresh"; //指定行為為跳轉
         RedirectMeta.Content = "3;url=" + ReadWebConfig.GetAppSettingValue("LoginPageURL"); //時間為三秒,跳轉到首頁
         this.Page.Header.Controls.Add(RedirectMeta);
     }
     else
     {
         if (!Page.IsPostBack)
         {
             if (loggedUser.User_isChecked)
             {
                 //已激活
                 LoginStatus.Text = "您已經完成用戶激活,無需再次激活";
                 LoginStatus.Visible = true;
             }
             else
             {
                 //未激活
                 UserOpr.SendVerifyMailToNewUser(loggedUser);
                 LoginStatus.Text = "確認信已經發往您登錄時所用郵箱,請查收";
                 LoginStatus.Visible = true;
             }
         }
     }
 }
開發者ID:0daydigger,項目名稱:Avfun,代碼行數:32,代碼來源:ResendVerifyMail.aspx.cs

示例3: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            var _configs = cf.Config_meta();

            if (_configs.ToList().Count > 0)
            {
                if (!string.IsNullOrEmpty(_configs.ToList()[0].CONFIG_FAVICON))
                    ltrFavicon.Text = "<link rel='shortcut icon' href='" + PathFiles.GetPathConfigs() + _configs.ToList()[0].CONFIG_FAVICON + "' />";
            }

            HtmlHead header = base.Header;
            HtmlMeta headerDes = new HtmlMeta();
            HtmlMeta headerKey = new HtmlMeta();
            headerDes.Name = "Description";
            headerKey.Name = "Keywords";

            header.Title = "Đăng ký đại lý";

            if (!IsPostBack)
            {

                Load_city();
                Load_distric(-1);
                loadYear();
                loadMonth();
                loadDay();

            }
        }
開發者ID:htphongqn,項目名稱:esell.yeuthietkeweb.com,代碼行數:29,代碼來源:Register_Partner.aspx.cs

示例4: InitializePage

        public void InitializePage(string _title, string _description, string _keywords, bool allowRobots)
        {
            string title = "cspad - C# pastebin and code snippets";
            title = title.Substring(0, 1).ToUpper() + title.Substring(1);
            Page.Title = title;

            HtmlMeta keywords = new HtmlMeta();
            keywords.Name = "keywords";
            keywords.Content = HttpUtility.HtmlAttributeEncode(_keywords) + "," +
                               "C#, C Sharp, code, programming, visual studio, snippets, source code";

            HtmlMeta description = new HtmlMeta();
            description.Name = "description";
            description.Content = _description == null ? "" : HttpUtility.HtmlAttributeEncode(_description);

            HeadPlaceHolder.Controls.AddAt(0, description);
            HeadPlaceHolder.Controls.AddAt(1, keywords);

            if (!allowRobots)
            {
                //<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
                HtmlMeta robots = new HtmlMeta();
                description.Name = "robots";
                description.Content = "NOINDEX, FOLLOW";
                HeadPlaceHolder.Controls.AddAt(2, description);
            }
        }
開發者ID:jgimness,項目名稱:cspad,代碼行數:27,代碼來源:Main.Master.cs

示例5: OnPreRender

		protected override void OnPreRender(EventArgs e)
		{
			base.OnPreRender(e);

            //if(!string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(Content))
            //{
            //    var metaTag = new HtmlMeta();
            //    metaTag.Name = Name;
            //    metaTag.Content = Content;
            //    Page.Header.Controls.Add(metaTag);
            //}

            if ((!string.IsNullOrEmpty(Name) || !string.IsNullOrEmpty(HttpEquiv)) && !string.IsNullOrEmpty(Content))
            {
                var metaTag = new HtmlMeta();

                if (!string.IsNullOrEmpty(HttpEquiv))
                    metaTag.HttpEquiv = HttpEquiv;
                if (!string.IsNullOrEmpty(Name))
                    metaTag.Name = Name;

                metaTag.Content = Content;

                if (InsertFirst)
                    Page.Header.Controls.AddAt(0, metaTag);
                else
                    Page.Header.Controls.Add(metaTag);
            }
		}
開發者ID:goedings,項目名稱:VendorLink,代碼行數:29,代碼來源:Meta.ascx.cs

示例6: UpdataMetagMainTitle

        public static void UpdataMetagMainTitle(System.Web.UI.Control PageView, string title)
        {
            if (title.Trim() == "")
                title = ConfigurationManager.AppSettings["title"];
            else
                title = title + " | " + ConfigurationManager.AppSettings["title"];
            PageView.Page.Title = title;

            HtmlMeta tagAuthor = new HtmlMeta();
            tagAuthor.Attributes.Add("name", "author");
            tagAuthor.Content = ConfigurationManager.AppSettings["author"];
            PageView.Page.Header.Controls.Add(tagAuthor);

            HtmlMeta tagKeywords = new HtmlMeta();
            tagKeywords.Attributes.Add("name", "Keywords");
            tagKeywords.Content = ConfigurationManager.AppSettings["keywords"];
            PageView.Page.Header.Controls.Add(tagKeywords);

            HtmlMeta tagDescription = new HtmlMeta();
            tagDescription.Attributes.Add("name", "description");
            tagDescription.Content = ConfigurationManager.AppSettings["description"];
            PageView.Page.Header.Controls.Add(tagDescription);

            HtmlMeta tagImage = new HtmlMeta();
            tagImage.Attributes.Add("name", "image");
            tagImage.Content = ConfigurationManager.AppSettings["image"];
            PageView.Page.Header.Controls.Add(tagImage);
        }
開發者ID:hoanghcmus,項目名稱:tomato,代碼行數:28,代碼來源:UpdataPageView.cs

示例7: Bind_meta_tags_cat

        public void Bind_meta_tags_cat()
        {
            #region Bind Meta Tags
            HtmlHead header = base.Header;
            HtmlMeta headerDes = new HtmlMeta();
            HtmlMeta headerKey = new HtmlMeta();
            //Face tags
            HtmlMeta propety = new HtmlMeta();
            HtmlMeta propetyTitle = new HtmlMeta();
            HtmlMeta propetyDesc = new HtmlMeta();
            //Twitter tags
            HtmlMeta propetyTw = new HtmlMeta();
            HtmlMeta propetyTitleTw = new HtmlMeta();
            HtmlMeta propetyDescTw = new HtmlMeta();

            headerDes.Name = "Description";
            headerKey.Name = "Keywords";

            header.Title = Utils.CStrDef(Session["Cat_seo_title"]);
            headerDes.Content = Utils.CStrDef(Session["Cat_seo_desc"]);
            headerKey.Content = Utils.CStrDef(Session["Cat_seo_keyword"]);

            if (string.IsNullOrEmpty(headerDes.Content))
            {
                headerDes.Content = "";
            }
            header.Controls.Add(headerDes);

            if (string.IsNullOrEmpty(headerKey.Content))
            {
                headerKey.Content = "";
            }

            header.Controls.Add(headerKey);
            //Facebook meta
            propety.Attributes.Add("property", "og:image");
            propety.Content = "" + System.Configuration.ConfigurationManager.AppSettings["URLWebsite"] + "" + PathFiles.GetPathCategory(Utils.CIntDef(Session["Cat_id"])) + Utils.CStrDef(Session["Cat_image1"]);
            header.Controls.Add(propety);
            //Title
            propetyTitle.Attributes.Add("property", "og:title");
            propetyTitle.Content = Utils.CStrDef(Session["Cat_seo_title"]);
            header.Controls.Add(propetyTitle);
            //Desc
            propetyDesc.Attributes.Add("property", "og:description");
            propetyDesc.Content = Utils.CStrDef(Session["Cat_seo_desc"]);
            header.Controls.Add(propetyDesc);
            //Twitter meta
            propetyTw.Attributes.Add("property", "twitter:image");
            propetyTw.Content = "" + System.Configuration.ConfigurationManager.AppSettings["URLWebsite"] + "" + PathFiles.GetPathCategory(Utils.CIntDef(Session["Cat_id"])) + Utils.CStrDef(Session["Cat_image1"]);
            header.Controls.Add(propetyTw);
            //Title
            propetyTitleTw.Attributes.Add("property", "twitter:title");
            propetyTitleTw.Content = Utils.CStrDef(Session["Cat_seo_desc"]);
            header.Controls.Add(propetyTitleTw);
            //Desc
            propetyDescTw.Attributes.Add("property", "twitter:description");
            propetyDescTw.Content = Utils.CStrDef(Session["Cat_seo_desc"]);
            header.Controls.Add(propetyDescTw);
            #endregion
        }
開發者ID:htphongqn,項目名稱:ecobuild,代碼行數:60,代碼來源:Main-en.aspx.cs

示例8: Bind_meta_tags_news

        public void Bind_meta_tags_news()
        {
            #region Bind Meta Tags
            HtmlHead header = base.Header;
            HtmlMeta headerDes = new HtmlMeta();
            HtmlMeta headerKey = new HtmlMeta();
            HtmlMeta propety = new HtmlMeta();

            headerDes.Name = "Description";
            headerKey.Name = "Keywords";
            header.Title = Utils.CStrDef(Session["News_seo_title"]);
            headerDes.Content = Utils.CStrDef(Session["News_seo_desc"]);
            headerKey.Content = Utils.CStrDef(Session["News_seo_keyword"]);
            propety.Attributes.Add("property", "og:image");
            propety.Content = "caodangngheytebinhduong" + PathFiles.GetPathNews(Utils.CIntDef(Session["News_id"])) + Utils.CStrDef(Session["News_image3"]);
            header.Controls.Add(propety);
            if (string.IsNullOrEmpty(headerDes.Content))
            {
                headerDes.Content = "";
            }
            header.Controls.Add(headerDes);

            if (string.IsNullOrEmpty(headerKey.Content))
            {
                headerKey.Content = "";
            }

            header.Controls.Add(headerKey);

            #endregion
        }
開發者ID:htphongqn,項目名稱:truongcaodangngheytebinhduong,代碼行數:31,代碼來源:Page_Default.aspx.cs

示例9: Bind_meta_tags_cat

        public void Bind_meta_tags_cat()
        {
            #region Bind Meta Tags
            HtmlHead header = base.Header;
            HtmlMeta headerDes = new HtmlMeta();
            HtmlMeta headerKey = new HtmlMeta();

            headerDes.Name = "Description";
            headerKey.Name = "Keywords";

            header.Title = Utils.CStrDef(Session["Cat_seo_title"]);
            headerDes.Content = Utils.CStrDef(Session["Cat_seo_desc"]);
            headerKey.Content = Utils.CStrDef(Session["Cat_seo_keyword"]);

            if (string.IsNullOrEmpty(headerDes.Content))
            {
                headerDes.Content = "";
            }
            header.Controls.Add(headerDes);

            if (string.IsNullOrEmpty(headerKey.Content))
            {
                headerKey.Content = "";
            }

            header.Controls.Add(headerKey);
            #endregion
        }
開發者ID:htphongqn,項目名稱:truongcaodangngheytebinhduong,代碼行數:28,代碼來源:Page_Default.aspx.cs

示例10: AddMeta

 /// <summary>
 /// 添加Meta標簽
 /// </summary>
 /// <param name="page">頁麵</param>
 /// <param name="name">Meta名字</param>
 /// <param name="content">Meta內容</param>
 public void AddMeta(System.Web.UI.Page page, string name, string content)
 {
     HtmlMeta meta = new HtmlMeta();
     meta.Name = name;
     meta.Content = content;
     page.Header.Controls.Add(meta);
 }
開發者ID:aj-hc,項目名稱:SZY,代碼行數:13,代碼來源:CssHelper.cs

示例11: getKeywords

        public static string getKeywords(string strHTMLCode)
        {
            Regex metaregex = new Regex(@"<meta\s*(?:(?:\b(\w|-)+\b\s*(?:=\s*(?:""[^""]*""|'" +
                          @"[^']*'|[^""'<> ]+)\s*)?)*)/?\s*>", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);
            List<HtmlMeta> MetaList = new List<HtmlMeta>();


            foreach (Match metamatch in metaregex.Matches(strHTMLCode))
            {
                HtmlMeta mymeta = new HtmlMeta();
                Regex submetaregex = new Regex(@"(?<name>\b(\w|-)+\b)\" +
                              @"s*=\s*(""(?<value>" +
                              @"[^""]*)""|'(?<value>[^']*)'" +
                              @"|(?<value>[^""'<> ]+)\s*)+",
                              RegexOptions.IgnoreCase |
                              RegexOptions.ExplicitCapture);


                foreach (Match submetamatch in submetaregex.Matches(metamatch.Value.ToString()))
                {
                    if (submetamatch.Groups["value"].ToString().ToLower() == "keywords")
                    {
                        //System.Windows.Forms.MessageBox.Show(submetamatch.NextMatch().Groups["value"].ToString().ToLower());
                        //System.Windows.Forms.MessageBox.Show(submetamatch.Groups["value"].ToString().ToLower());
                        //File.WriteAllText(Directory.GetCurrentDirectory() + "\\WebSource.txt", submetamatch.Groups["value"].ToString());
                        return submetamatch.NextMatch().Groups["value"].ToString();
                    }
                }
            }
            return "";
        }
開發者ID:JakeLardinois,項目名稱:WebSpider,代碼行數:31,代碼來源:SpiderDataGetter.cs

示例12: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            //Add meta info
            HtmlMeta meta1;

            meta1 = new HtmlMeta();
            meta1.Name = "robots";
            meta1.Content = "noindex, nofollow";
            Page.Header.Controls.Add(meta1);
            Page.Header.Controls.Add(new LiteralControl("\n"));

            //Show test label if organic link referer
            //Set session variable based on referer
            string useragentstring = "";
            if (Request.ServerVariables["HTTP_USER_AGENT"] != null)
                useragentstring = Request.ServerVariables["HTTP_USER_AGENT"].ToString().ToLower();

            Regex regEx_apple = new Regex("ipod|iphone|ipad");
            Regex regEx_android = new Regex("android");
            if (regEx_apple.Match(useragentstring).Success)
            {
                Response.Redirect("http://itunes.apple.com/us/app/best-pick-reports/id494057962?mt=8");
            }

            if (regEx_android.Match(useragentstring).Success)
            {
                Response.Redirect("https://play.google.com/store/apps/details?id=com.brotherfish");
            }
        }
開發者ID:SStewart-Ebsco,項目名稱:TFS-Merge,代碼行數:29,代碼來源:mobileredirect.aspx.cs

示例13: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            HtmlHead header = base.Header;
            HtmlMeta headerDes = new HtmlMeta();
            HtmlMeta headerKey = new HtmlMeta();
            headerDes.Name = "Description";
            headerKey.Name = "Keywords";
            var _configs = cf.Config_meta();

            if (_configs.ToList().Count > 0)
            {
                if (!string.IsNullOrEmpty(_configs.ToList()[0].CONFIG_FAVICON))
                    ltrFavicon.Text = "<link rel='shortcut icon' href='" + PathFiles.GetPathConfigs() + _configs.ToList()[0].CONFIG_FAVICON + "' />";
                header.Title = "Giới thiệu";

                headerDes.Content = _configs.ToList()[0].CONFIG_DESCRIPTION;
                header.Controls.Add(headerDes);

                headerKey.Content = _configs.ToList()[0].CONFIG_KEYWORD;
                header.Controls.Add(headerKey);
            }
            else
            {
                header.Title = "Enews Standard V1.0";

                headerDes.Content = "Enews Standard V1.0";
                header.Controls.Add(headerDes);

                headerKey.Content = "Enews Standard V1.0";
                header.Controls.Add(headerKey);
            }
        }
開發者ID:htphongqn,項目名稱:ecobuild,代碼行數:32,代碼來源:intro.aspx.cs

示例14: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            _iUserID = Utils.CIntDef(Session["USER_ID"]);
                if (_iUserID == 0) Response.Redirect("/");
            var _configs = cf.Config_meta();

            if (_configs.ToList().Count > 0)
            {
                if (!string.IsNullOrEmpty(_configs.ToList()[0].CONFIG_FAVICON))
                    ltrFavicon.Text = "<link rel='shortcut icon' href='" + PathFiles.GetPathConfigs() + _configs.ToList()[0].CONFIG_FAVICON + "' />";
            }

            HtmlHead header = base.Header;
            HtmlMeta headerDes = new HtmlMeta();
            HtmlMeta headerKey = new HtmlMeta();
            headerDes.Name = "Description";
            headerKey.Name = "Keywords";

            header.Title = "Thông tin cá nhân";
            if (!IsPostBack)
            {
                Load_city();
                Load_distric(-1);
                Loaduser_info();
            }
        }
開發者ID:htphongqn,項目名稱:esell.yeuthietkeweb.com,代碼行數:26,代碼來源:User-address.aspx.cs

示例15: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            var _configs = cf.Config_meta();

            if (_configs.ToList().Count > 0)
            {
                if (!string.IsNullOrEmpty(_configs.ToList()[0].CONFIG_FAVICON))
                    ltrFavicon.Text = "<link rel='shortcut icon' href='" + PathFiles.GetPathConfigs() + _configs.ToList()[0].CONFIG_FAVICON + "' />";
            }

            HtmlHead header = base.Header;
            HtmlMeta headerDes = new HtmlMeta();
            HtmlMeta headerKey = new HtmlMeta();
            headerDes.Name = "Description";
            headerKey.Name = "Keywords";

            header.Title = "Thanh toán";
            Guid _guid = (Guid)Session["news_guid"];
            if (!pay.Check_Cart(_guid))
            {
                Response.Redirect("/", false);
            }
            loadBanking();
            loadCast();
        }
開發者ID:htphongqn,項目名稱:esell.yeuthietkeweb.com,代碼行數:25,代碼來源:Payment-step3.aspx.cs


注:本文中的System.Web.UI.HtmlControls.HtmlMeta類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。