Friday, 19 October 2012

dynamic meta tag in asp.net c#

add meta tag from coading in asp.net c#


Step 1: Create a object of the HtmlMeta class
          
       HtmlMeta metaObject = new HtmlMeta();

Step 2: Add the attributes to the meta object
        metaObject .Attributes.Add("name", "keywords");
        metaObject .Attributes.Add("content", "keyword text here");

Step 3: Add the meta control to the header part of the page
       Header.Controls.Add(metaObject);

No comments:

Post a Comment