html | Page 1 | HowtoASP.NET

How to replace \n line breaks with HTML <br /> line breaks in GridView

This is very common scenario when you would like to show well formatted GridView content. To do this you could use the ItemTemplate which is used by default to render the cell for each row:

<%# ((string)Eval(“GridviewContent”)).Replace(“\n”, “<br />”) %>

Related TutorialsHow to document web service in ASP.NET in C#
How to make XML nonhierarchical data binding
How to encrypt […]

Recommended ASP.NET Examples