How to highlight an HTML content and save it to the database as per user for future loads

573 Views Asked by At

I'm trying to highlight the selected text contents by the user inside the HTML page.I have highlited the text using jquery (dot net). Now I need to save some information to the database that makes me able to highlight the same contents again for future loads of the same page, taking care of all inner elements that the text could have inside. i.e., Have a base HTML files thats same for every user, given the freedom to user to highlight content in provided page, after he highlites, information needs to saved to database against each user, so that when user open the same html file again,(HTML files shown in a panel) he gets the same page with the highlighing he had done earlier.

Please suggest what information should I save to database.. any pointer how would I move ahead..

Thanks in advance your help.

1

There are 1 best solutions below

1
On

not a dot net expert , but it seems like you are storing content in database, when fetching they need to be highlighted.

the best way is save content as html or write you own highlight tag

and then replace it to blank when highlight not needed , and replace it with <div style="background-color:red"> to highlight.

Hope you are getting the approch.

And if you are using HTML files , then it is always better to store them in database. String manuplation for every request will be much heavy task to do.