?
Solved

How to display multi-space for ListItem of DropDownList

Posted on 2004-08-21
3
Medium Priority
?
226 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 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month13 days, 6 hours left to enroll

801 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