Example #1
0
        /// <summary>
        /// Set meta tag and its value.
        /// </summary>
        /// <param name="metaTag"></param>
        /// <param name="value"></param>
        public void SetMetaTag(MainMetaTags metaTag, string value)
        {
            switch (metaTag)
            {
            case MainMetaTags.Title:
                this.SetTitle(value);
                break;

            case MainMetaTags.Description:
                this.SetDescription(value);
                break;

            case MainMetaTags.Keywords:
                this.Keywords.Value = value;
                break;

            case MainMetaTags.Image:
                this.SetImage(value);
                break;

            case MainMetaTags.Author:
                this.Author.Value = value;
                break;

            default:
                break;
            }
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MetaTagAttribute"/> class.
 /// </summary>
 /// <param name="type"></param>
 /// <param name="value"></param>
 /// <param name="extractValueFromViewData"></param>
 public MetaTagAttribute(MainMetaTags type, string value, bool extractValueFromViewData = false)
 {
     this.Type  = type;
     this.Value = value;
     this.ExtractValueFromViewData = extractValueFromViewData;
 }