FreeTexBox control and "potentially dangerous Request.Form value was detected by the client"
You can try another solution.
if(!this.Page.ClientScript.IsOnSubmitStatementRegistered("Replace")) { string script = @"if (Page_IsValid){FTB_API['" + txtBox.ClientID + @"'].initialized=false; FTB_API['" + txtBox.ClientID + @"'].htmlEditor.value=FTB_FreeTextBox.prototype.HtmlEncode( FTB_API['" + txtBox.ClientID + @"'].htmlEditor.value);}"; this.Page.ClientScript.RegisterOnSubmitStatement(this.Page.GetType(), "Replace", script); }
and do not forget to replace the characters when sending a string from the server to the client application
if(!String.IsNullOrEmpty(yourstring)) txtBox.Text= yourstring.Replace(">", ">").Replace("<", "<").Replace("&", "&").Replace(""", ('"').ToString()).Replace("’", "'");
In this case, you do not need to disable ValidateRequest. You can also replace characters before storing a string in the database.
source share