ali raza

C#, .Net , and my thoughts

How to add dynamic meta tags in

Hi all you can add meta tags like that in page

HtmlMeta _MyName = new HtmlMeta();
_MyName.Name =” Ali Raza”;
_MyName.Content =” just in and test “;

One response to “How to add dynamic meta tags in

  1. Kashif Abbas July 13, 2008 at 10:42 am

    Adding Meta Tags or Stylesheets to ASP.NET 2.0 Pages Programatically

    I came across a blog entry by Rich Strahl about adding stylesheets to ASP.NET 2.0 web pages. The way Rick explained it is that he’d recommend a contentplaceholder in the header section of a masterpage and to set the properties there. That’s just fine and dandy if the content you’d like to set is in a Masterpage to Page setup. However, you can easily set the header information programatically in 2.0 by accessing the new Header class. Here is an example of how to do this:

    Dim KeywordsHtmlMeta as new HtmlMeta

    KeywordsHtmlMeta.Name = “Keywords”
    KeywordsHtmlMeta.Content = “ASP.NET, Blog, Jason, Gaylord”

    Dim CSSHtmlLink as new HtmlLink

    CSSHtmlLink.Attributes.Add(“rel”, “Stylesheet”)
    CSSHtmlLink.Attributes.Add(“type”, “text/css”)
    CSSHtmlLink.Attributes.Add(“media”, “all”)

    Published Tuesday, May 30, 2006 11:04 AM by Jason N. Gaylord
    Filed under: General Software Development, Tips and Tricks, ASP.NET

    Single Tag Method (other source)

    // Render:
    HtmlMeta meta = new HtmlMeta();
    meta.Name = “keywords”;
    meta.Content = “Some words listed here”;


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: