Trying to display a multiline message using html line breaks in an asp:Label

I'm pulling text from a database and doing the assignment in the code behind (lblMsg=" ") to populate an asp:Label,  Unfortunately, the text has some html line breaks in it.  For example: Result: <br /> The item must have an associated ID. <br /> Make this change before proceeding. I tried using both asp:Label and asp:Literal and even asp:TextBox (would prefer label or literal).  The only thing that shows on the display is Result:  (the remainder of the text is missing).  I tried using \r\n and also Environment.NewLine in place of the <br />, and this at least allowed it to display all of the text, but it was on one line, and the html items were still present in the text on the display, e.g., Result:\r\nThe item must ..... 

Is there a way to display the label/literal text message on multiple lines, and without showing the html tags?

Thanks in advance for your help. 


1 Reply

KR Keerthana Rajendran Syncfusion Team August 30, 2021 04:42 AM UTC

Hi Michael, 
 
Thanks for contacting Syncfusion support.  
 
We checked your requirement to display multiline message using asp:Label or asp:TextBox. We suggest you to refer the following blogs for general queries in Asp.Net.  
 
 
 
We would also like to let you know that we have Syncfusion MaskEdit TextBox similar to the asp:TextBox. 
 
Refer to the following link for more details on Syncfusion Asp.Net MaskEdit TextBox. 
 
 
 
Please let us know if you need any further assistance with Syncfusion components. 
 
Regards, 
Keerthana R.  


Loader.
Up arrow icon