473,385 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

  in a ListItem doesn't seem to work

I am trying to add an indent to a Dropdown control. I prefix the text for
the ListItem with a couple   but it doesn't render the tags to spaces ,
instead the dropdown list shows:

MainItem
  SubItem
  SubItem

Thanks,
--
Bill Green
Nov 18 '05 #1
2 3290
the list item's text property does not support html, only text

-- bruce (sqlwok.com)
"Bill Green" <gr********@hotmail.com> wrote in message
news:uS**************@TK2MSFTNGP10.phx.gbl...
I am trying to add an indent to a Dropdown control. I prefix the text for
the ListItem with a couple &nbsp; but it doesn't render the tags to spaces , instead the dropdown list shows:

MainItem
&nbsp;&nbsp;SubItem
&nbsp;&nbsp;SubItem

Thanks,
--
Bill Green

Nov 18 '05 #2
Here is a solution to that problem that was posted some time ago by someone
else.

Dim Padding As String
Dim writer As New System.IO.StringWriter()
Dim DecodedString As String

Padding = "&nbsp;&nbsp;"
Server.HtmlDecode(Padding, writer)
Padding = writer.ToString()

myDropDownList2.Items.Add(Padding & " MVP's")

Padding = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;"
Server.HtmlDecode(Padding, writer)
Padding = writer.ToString()

myDropDownList2.Items.Add(Padding & " MVP's")

myDropDownList2.Items.Add("MVP's" & Padding & "Do Their best")

"Bill Green" <gr********@hotmail.com> wrote in message
news:uS**************@TK2MSFTNGP10.phx.gbl...
I am trying to add an indent to a Dropdown control. I prefix the text for
the ListItem with a couple &nbsp; but it doesn't render the tags to spaces , instead the dropdown list shows:

MainItem
&nbsp;&nbsp;SubItem
&nbsp;&nbsp;SubItem

Thanks,
--
Bill Green

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Tjerk Wolterink | last post by:
In XHTML the entity nbsp stands for   A normal space like " " is also displayed as an normal space, but multiple spaces like " " are interpreted as 1 space in the xhtml page. So there comes...
5
by: Naveen K Kohli | last post by:
I am try to set the text of the drop down list item as ListItem li = new ListItem(); li.Text = "&nbsp;"+"MyValue"; myDropDown.Items.Add("li); The intent is to add a spacing in front of the...
2
by: Rob T | last post by:
I have a dropdown list that I would like to put in a bunch of &nbsp;'s into it (I'm setting the font to a monospace font so I can show a couple of columns nice and neat). In the old asp days, I...
5
by: Tim | last post by:
Hi, I am trying to load up a drop list with semi aligned columns like so: Item 2 Something Else etc. To do so, I have tried to fill the Text valus of ListItems like so:
9
by: Jouni Karppinen | last post by:
I create a HTMLTable in my C# code and then add rows and cells into that table. I'm trying to set top and bottom border for each cell by using stylesheet and it works as far as cell has some text...
1
by: PJ | last post by:
Is it possible to prevent the drop down list from html encoding the text in ListItems? I would like to put some spaces to add padding to certain items with spaces, but when it it rendered asp.net...
3
by: yawnmoth | last post by:
<? echo 'a'.trim(html_entity_decode('&nbsp;a&nbsp;')).'a'; ?> Shouldn't PHP output aaa? Looking at the documentation for trim I see that it doesn't support chr(0xA0) (eg....
28
by: entfred | last post by:
I have the following line of html: &nbsp;&nbsp1234&nbsp;&nbsp;&nbsp;&nbsp;&nbspabc&nbsp;&nbsp;&nbspyow In Internet Explorer 6.0, the columns look ok using the above html: 1234 abcd ...
7
by: Sebarry | last post by:
Hi, I'm having trouble creating a blank table row in Javascript using document.createElement( '&nbsp;' ). When I look at the generated source it has intrepreted it as <td>&amp;nbsp;</td>. What do I...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.