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. className attributes??

className attributes??

Scheduled Pinned Locked Moved ASP.NET
questioncsharpcssasp-netsysadmin
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.
  • A Offline
    A Offline
    Andrew Quinn AUS
    wrote on last edited by
    #1

    Apologises for such a newbie question, but does anyone know how to set the className attributes for ASP.NET server controls, e.g. Dynamically creating a table using HtmlTableRow/Cell and I can't for the life of me see how to set the className attribute. I can see the Style collection, but what about assigning CSS class names????? Thanks in advance Andy

    A 1 Reply Last reply
    0
    • A Andrew Quinn AUS

      Apologises for such a newbie question, but does anyone know how to set the className attributes for ASP.NET server controls, e.g. Dynamically creating a table using HtmlTableRow/Cell and I can't for the life of me see how to set the className attribute. I can see the Style collection, but what about assigning CSS class names????? Thanks in advance Andy

      A Offline
      A Offline
      Andrew Quinn AUS
      wrote on last edited by
      #2

      Ahhhhhhh... for those of you that are as cranially vacant :-O as I seem, the answer: the Attribute map, e.g. for (int i=0; i < collMenu.Count; i++) { XmlNode nodeMenuItem = collMenu[i]; // Generate the MENU options available.... HtmlTableRow tr = new HtmlTableRow(); HtmlTableCell td = new HtmlTableCell(); XmlNode nodeTitle = nodeMenuItem.SelectSingleNode("./Title"); td.Attributes["class"] = "xyz"; td.InnerText = nodeTitle.InnerText; tr.Cells.Add(td); idMain.Rows.Add(tr); } Obvious now, but for such an important property of any HTML element you'd think this would have it's own defined property just like the Align,VAlign etc. ?? No ?? Cheers, Andy

      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