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. Literal spaces in a DropDownList [WAS: Literal space in a DropDownList]

Literal spaces in a DropDownList [WAS: Literal space in a DropDownList]

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomtutorialquestion
3 Posts 2 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.
  • J Offline
    J Offline
    Jon Sagara
    wrote on last edited by
    #1

    I'm trying to insert multiple consecutive space characters into some ListItems in a DropDownList. However, ASP.NET is converting my " " into " ". Anyone know how to insert literal spaces when populating a DDL programmatically?

    Jon Sagara You're a cross between a retarded person and a very smart man. -- My wife :-D
    My Articles

    R 1 Reply Last reply
    0
    • J Jon Sagara

      I'm trying to insert multiple consecutive space characters into some ListItems in a DropDownList. However, ASP.NET is converting my " " into " ". Anyone know how to insert literal spaces when populating a DDL programmatically?

      Jon Sagara You're a cross between a retarded person and a very smart man. -- My wife :-D
      My Articles

      R Offline
      R Offline
      Ryan Bost
      wrote on last edited by
      #2

      Don't use " " Just add the value with a space in it. System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("Ant Eater", "Ant Eater"); DropDownList1.Items.Add(li);

      J 1 Reply Last reply
      0
      • R Ryan Bost

        Don't use " " Just add the value with a space in it. System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem("Ant Eater", "Ant Eater"); DropDownList1.Items.Add(li);

        J Offline
        J Offline
        Jon Sagara
        wrote on last edited by
        #3

        I mis-typed my subject line. I'm trying to add multiple consecutive spaces, which, as you know, only get rendered as one space in HTML. I worked around it by using dashes instead.

        Jon Sagara You're a cross between a retarded person and a very smart man. -- My wife :-D
        My Articles

        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