Hi
It would appear that the Text property of the ListItem will only allow
a single line of plain text. It converts < > to < and >
respectively (so renders them visibly on the page as < > ) and will
ignore escaped control characters (e.g. \n in C#).
This is unlike the behaviour of the Text property of say a Label
control which does allow HTML tags in string literals and will render
them unfiltered. (The label control also puts line breaks in where
there are \n escape characters)
Without knowing more about the context in which you are trying to
achieve this I can only suggest you consider building your list in
code using a Literal control (designed for programmatic generation of
raw HTML). For example:
Assume you have placed a Literal control named ALiteral on the page
using the designer
ALiteral.Text = "<ul>";
ALiteral.Text += "<li>Line 1 - some text<br />continued on next line
with no bullet</li>";
//... other lines
ALiteral.Text += "</ul>";
In fact here is another example where the list is generated
programmatically from a DataTable using a DataSet
(It produces a bulleted list of 'Myths' surround a particular topic
taken from a project I am working on. Line breaks are put in after
each myth and the truth text on the line underneath. The bullets and
the italicised text help emphasise each fallacious statement on the
first line of each entry in the list:
DataSet1TableAdapters.mythsTableAdapter taMyths
= new DataSet1TableAdapters.mythsTableAdapter();
DataSet1.mythsDataTable dtMyths = taMyths.GetData();
Literal1.Text = "<ul>";
foreach (DataRowView drvMyth in dtMyths.DefaultView)
{
Literal1.Text += said:
(string)drvMyth["reality_text"] + "</
li>";
}
Literal1.Text += "</ul>";
HTH