This is a migrated thread and some comments may be shown as answers.

RadEditor,Track Change Content Security Problem

3 Answers 59 Views
Editor
This is a migrated thread and some comments may be shown as answers.
章民
Top achievements
Rank 1
章民 asked on 29 Oct 2012, 12:28 AM
I use cookie to save TheEditor's content, but when I load the cookie,visual studio will break at Request.Cookie and show the error message "Detected a potentially dangerous Request.Cookies value from the client, please reference http://go.microsoft.com/fwlink/?LinkID=212874"
Does someone know how to solve this problem?
Protected Sub ButtonSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonSave.Click
    Response.Cookies("myText").Value = theEditor.Content
End Sub
  
Protected Sub ButtonLoad_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonLoad.Click
    theEditor.Content = Request.Cookies("myText").Value
End Sub

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 31 Oct 2012, 01:16 PM
Hello,

I think that it is not a good idea to save the content in a cookie due to that the cookie has a quite limited size and the security issues that its usage imposes.

Try to encode the < and > symbols to &lt; and &gt;. Have you also tried to disable the validation as suggested in http://go.microsoft.com/fwlink/?LinkID=212874?

Regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
章民
Top achievements
Rank 1
answered on 02 Nov 2012, 01:01 AM
Thanks. But now I use session.
Protected Sub ButtonSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonSave.Click
    Session("txt") = theEditor.Content
 
End Sub
 
Protected Sub ButtonLoad_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonLoad.Click
    theEditor.Content = Session("txt")
End Sub
0
Accepted
Dobromir
Telerik team
answered on 05 Nov 2012, 04:11 PM
Hi Akira,

Have you tried encoding/decoding the RadEditor's content as Rumen sugested in his answer?

In order to safely encode/decode the editor;s content you can use HttpServerUtility's EncodeHtml() and DecodeHtml() methods.

Regards,
Dobromir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
章民
Top achievements
Rank 1
Answers by
Rumen
Telerik team
章民
Top achievements
Rank 1
Dobromir
Telerik team
Share this question
or