I think choice of language was clear. I don't think that VB uses ";" at the
end of statement. Thats not the point.
ListItem truncates the leading spaces. And if you have any HTML decoded
string, it will encode it and display as "&ndp;". The solution to this
issue can be found at floowing link.,
http://www.netomatix.com/IndentDropdownList.aspx
Naveen
"Tyrone" <t_davisjr@hotmail.com> wrote in message
news:08a901c36134$43d82be0$a101280a@phx.gbl...[color=blue]
> What I think the issue is is that you are using the "+" to
> add both strings..i think you must use the & char.
>
> Well in VB.Net in C# your right on the money I think..you
> use the "+"..but you didn't specify any language
>
> ListItem li = new ListItem();
> li.Text = " " & "MyValue";
>
> myDropDown.Items.Add("li");
>[color=green]
> >-----Original Message-----
> >Thanks Justin,
> >I tried that. It truncates the blank spaces at the start.[/color]
> In regular ASP[color=green]
> >apps I was able to do..
> >
> ><option> MyValue
> >
> >I am trying to do the same thing with DropdownList control
> >
> >
> >"S. Justin Gengo" <sjgengo@aboutfortunate.com> wrote in[/color]
> message[color=green]
> >news:umUWYZRYDHA.4020@tk2msftngp13.phx.gbl...[color=darkred]
> >> Naveen,
> >>
> >> Drop down lists don't use the same encoding as regular[/color][/color]
> html on the page.[color=green][color=darkred]
> >>
> >> Just add a regular " " space.
> >>
> >> Sincerely,
> >>
> >>
> >> --
> >> S. Justin Gengo, MCP
> >> Web Developer
> >>
> >> Free code library at:
> >>
www.aboutfortunate.com
> >>
> >> "Out of chaos comes order."
> >> Nietzche
> >>
> >>
> >> "Naveen K Kohli" <naveenkohli@hotmail.com> wrote in[/color][/color]
> message[color=green][color=darkred]
> >> news:ONxW1QRYDHA.1492@TK2MSFTNGP12.phx.gbl...
> >> > I am try to set the text of the drop down list item as
> >> >
> >> > ListItem li = new ListItem();
> >> > li.Text = " "+"MyValue";
> >> >
> >> > myDropDown.Items.Add("li);
> >> >
> >> > The intent is to add a spacing in front of the text.[/color][/color]
> Its not doing what[color=green]
> >I[color=darkred]
> >> am
> >> > trying to do. The text shows up as "&MyValue"
> >> >
> >> > How can this be accomplished?
> >> >
> >> >
> >>
> >>[/color]
> >
> >
> >.
> >[/color][/color]