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