Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Meta Tags

Meta Tags

Scheduled Pinned Locked Moved ASP.NET
csharpasp-net
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MyThread
    wrote on last edited by
    #1

    Hi All, I want to use MetaTags so that when I google that word on the internet, it finds it. Can you please let me know how I can do it using ASp.Net or VB.Net. Thanks a lot!

    M D 2 Replies Last reply
    0
    • M MyThread

      Hi All, I want to use MetaTags so that when I google that word on the internet, it finds it. Can you please let me know how I can do it using ASp.Net or VB.Net. Thanks a lot!

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      Hi there. An ASP.NET page (.aspx) can contain any regular <html> tags, so if you want to use a <meta> tag, just put it between the <head> tags on your .aspx page, like you would with a normal .html page.

      1 Reply Last reply
      0
      • M MyThread

        Hi All, I want to use MetaTags so that when I google that word on the internet, it finds it. Can you please let me know how I can do it using ASp.Net or VB.Net. Thanks a lot!

        D Offline
        D Offline
        DavidNohejl
        wrote on last edited by
        #3

        hi, you can use meta tags same way as in plain (X)HTML:

        // default.aspx
        <meta name="keywords" content="something meaningful" />
        

        or, you can generate meta tags dynamically: (similarly as in PHP or other server-side scripting languages)

        // Response is .NET class for working with HTTP response
        // <% ... %> is notation for inline script (same as  in PHP)
        <% Response.Write("<meta name=.....>") %>
        

        Code above is in C# syntax, however VB.NET syntax will be very similar. As for getting good position in Google (and other search engines too), meta tags are only one of criteria for page ranking. See also: Google Technology Overview[^] "Don't Submit to search engines" article on CP[^] Last but not least my hard way learned experience: for indexers (Googlebot & comp) content-type matters. I had application/xhtml+xml; content type on my site, and Google don't index files of this type :(( So I had to switch to html/text! grrrrrr (actually I only made swich for user agents - xhtml for Mozilla & Opera, xml/text for IE and html/text for others ) best regards, David 'DNH' Nohejl Never forget: "Stay kul and happy" (I.A.)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups