+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Meta Tags with Google

Meta Tags with Google

4 posts, 0 answered
  1. Armysniper
    Armysniper avatar
    126 posts
    Registered:
    03 Mar 2005
    30 Nov 2009
    Link to this post
    I need to add a meta tag to my home page or to a template that came from google. I went into the template and tried to create a meta entry for the template, but the name field is a drop down and I need to specify it as "google-site-verification". How can I do this?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    30 Nov 2009
    Link to this post
    Hi Armysniper,

    Crate an user control and use HtmlMeta class to add the tags to your page head.

    Sample code:

    public string MetaTagName 
      {
          get 
          {
              return metaTagName;
          }
          set 
          {
              metaTagName = value;
          }
      }
     
      public string MetaTagContent
      {
          get
          {
              return metaTagContent;
          }
          set
          {
              metaTagContent = value;
          }
      }
     
     
      protected void Page_Load(object sender, EventArgs e)
      {
          HtmlMeta metaTag = new HtmlMeta();
          metaTag.Name = this.MetaTagName;
          metaTag.Content = this.MetaTagContent;
          this.Page.Header.Controls.Add(metaTag);
     
      }
     
      private string metaTagName;
      private string metaTagContent;


    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Armysniper
    Armysniper avatar
    126 posts
    Registered:
    03 Mar 2005
    30 Nov 2009
    Link to this post
    I could also just add it manually to the template too though right? :) This is a simple one off meta tag.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    01 Dec 2009
    Link to this post
    Hi Armysniper,

    You can create a user control and drop it on your master or ICms page.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered