search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

New Lines in DataTextField

Asked by Cezar
7 years ago.

I would like to have a description of event looking like this:

Name + Surname
Email
Phone
Ilość osób: number

My code to get that string looks that:
public string Opis
{ get
{
return Osoba + Environment.NewLine + Email + Environment.NewLine + Telefon + Environment.NewLine + "Ilość osób: " + IloscOsob;
}
}

And got value looks that: Opis = "Przemysław Kościelniak\r\nfmgroup.damian.k@gmail.com\r\n510238338\r\nIlość osób: 44"

Like you can see on screen there are no new lines... How can I do them? <br> or <br /> replaced Environment.NewLine didn't work.

Answer posted by Cezar
7 years ago.

Oh nevermind, I just replaced Environment.NewLine with <br /> and in wrote
protected override void OnBeforeEventRender(BeforeEventRenderArgs e)
{
e.Html = e.Text;
}
works nice now, there are new lines now as I wanted.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.