I have an ASP.NET DropDownList
control that retrieves the first and last name from a column in the database. Instead of having just one space between the first and last name, I want there to be three. How do I add the extra spaces between the two pieces of text in the DropDownList
?
views:
400answers:
1
+2
A:
Add instead of space character, and HtmlDecode all elements after binding :
string[] items = new string[] {
"name& nbsp;& nbsp;& nbsp;surname1",
"name& nbsp;& nbsp;& nbsp;surname2" };
ddl.DataSource = items;
ddl.DataBind();
foreach (ListItem item in ddl.Items)
{
item.Text = HttpUtility.HtmlDecode(item.Text);
}
Canavar
2009-09-14 15:26:34