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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Dynamically change color of xml sitemap titles

Dynamically change color of xml sitemap titles

Scheduled Pinned Locked Moved ASP.NET
xmlquestion
2 Posts 1 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.
  • C Offline
    C Offline
    compninja25
    wrote on last edited by
    #1

    Hi everyone!   I have a sitemap.xml that contains my links to the various sub pages.   What I would like to do is have the system change the color of some of the titles so they stick out when new content is released.   I've tried simply adding <code><span style="font-color:red">(new!)</span></code> in the xml file but that always bombs out.   Can this be done?   The only other way I could think of pulling it off would be dynamically checking all of the sitemap nodes for "(new!)" somewhere in the title and then adding the span block while the page is loading. Thanks!

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    C 1 Reply Last reply
    0
    • C compninja25

      Hi everyone!   I have a sitemap.xml that contains my links to the various sub pages.   What I would like to do is have the system change the color of some of the titles so they stick out when new content is released.   I've tried simply adding <code><span style="font-color:red">(new!)</span></code> in the xml file but that always bombs out.   Can this be done?   The only other way I could think of pulling it off would be dynamically checking all of the sitemap nodes for "(new!)" somewhere in the title and then adding the span block while the page is loading. Thanks!

      Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

      C Offline
      C Offline
      compninja25
      wrote on last edited by
      #2

      If anyone runs into this, I figured out how to pull it off using the ItemDataBound event.

          protected void Menu1\_MenuItemDataBound(object sender, MenuEventArgs e)
          {
              if (e.Item.Text.Contains("(NEW!)"))
              {              
                e.Item.Text = e.Item.Text.Replace("(NEW!)","<span style=\\"color:red\\">(NEW!)</span>");                
              }
      
          }
      

      Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

      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