Solved

How to display multi-space for ListItem of DropDownList

Posted on 2004-08-21
3
222 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

861 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