Solved

How to display multi-space for ListItem of DropDownList

Posted on 2004-08-21
3
218 Views
Last Modified: 2006-11-17
code:

ListItem item;
item.Value = "value";
item.Text = "multi                    space";
dropdownlist1.Items.Add(item);

but,in browser,the 'select' element display 'multi space'.
How shall I do it?
0
Comment
Question by:fjczq
3 Comments
 
LVL 20

Accepted Solution

by:
ihenry earned 50 total points
ID: 11862723
try this

string nonBreakingSpaces = new string( ' ', 10 );
nonBreakingSpaces = nonBreakingSpaces.Replace( " ", " " );
ListItem item;
item.Value = "value";
item.Text = "multi" + nonBreakingSpaces + "space";
dropdownlist1.Items.Add(item);


HTH
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now