0

How can we save the current selection at server end. Because result is saved as the string when we return the result. I am using C# .net in the server end. The problem is that when i save the current selection it will return me the string. Then on restore of the selection it will treat him like string and desired text not selected. How can i convert string back to window range object.

Also i want to include one more thing here that if i save the

var range = window.getSelection().getRangeAt(0);

and then restore it on client side it is working perfectly.

Thanks in advance.

ovais
  • 339
  • 2
  • 13
  • You could look at the [Serializer module](https://code.google.com/p/rangy/wiki/SerializerModule) of my Rangy library. – Tim Down Sep 18 '13 at 23:26
  • Thanks Tim this is very helpful and handy Library. Also can you tell me that if I highlight the selected text range then how can I restore the selection? As using rangy i get the same result before and after the highlight being applied. I have used document.execCommand() to include the back color. – ovais Sep 20 '13 at 11:21

0 Answers0