How do I display HTML tags as Plain Text in columns?

How do I display HTML tags as Plain Text in columns?

rprahaladrprahalad Posts: 20Questions: 5Answers: 0
edited June 2022 in General

I went through similar questions. But I could not find the correct answer. If the user inputs Notes with HTML content in it, how do I display the entire HTML content as text? For example: If Notes contains '5 is > then 3 but < than 8', it should show verbatim as '5 is > then 3 but < than 8' without escaping the '<' and '>'.

I am using MVC as the backend and I return a JSON result to populate the data table.

I want to render the Notes column below with the saved HTML content .

Thanks

"columns": [
                          {"data": "Notes",  },
                          {"data": "ID",  "orderable": false, "render": function (data) {
                                        return '<a class="actionLink" href="save/' + data + '">Edit</a>'; } },
                          {"data": "ID", "orderable": false, "render": function (data) {
                                        return '<a class="actionLink" href="delete/' + data + '">Delete</a>'; } },

            ],

Answers

Sign In or Register to comment.