TheVillageIdiot27
Programmer
I have a grid view on a web form (c#) in which there is a template field which is linked to a comments field in an SQL database which contains text formatted as an HTML fragment.
This field can get quite long so I am trying to return a substring of the this formatted HTML (for example the first 50 characters).
What I seem unable to do is to ensure the markup of the HTML remains intact as it is truncated and I am not left with half a tag, an unclosed bold tag or similar.
If anyone has any ideas I would gratefully receive them.
This field can get quite long so I am trying to return a substring of the this formatted HTML (for example the first 50 characters).
What I seem unable to do is to ensure the markup of the HTML remains intact as it is truncated and I am not left with half a tag, an unclosed bold tag or similar.
If anyone has any ideas I would gratefully receive them.