Solved

How to display multi-space for ListItem of DropDownList

Posted on 2004-08-21
3
223 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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