Uploader together with CKEditor both in updatepanel

Last post 08-10-2011, 7:00 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  08-10-2011, 3:18 AM 69466

    Uploader together with CKEditor both in updatepanel

    Hi,
     
    I have CKEditor in an updatepanel containing text: <h1>hello</h1>
    In another updatepanel I have your Ajax Uploader.
     
    When uploading a file I get the error:
    A potentially dangerous Request.Form value was detected from the client (CKEditorEdit="<h1>hello</h1>")
     
    Because both controls are in their own update panels, this should never happen. The contents of CKEditor should not be submitted. What can I do to solve this?
     
    This is the code I am using:
     
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="test.aspx.vb" Inherits="EasyOrganizer.test" %>
    <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
     
        <form id="form1" runat="server">
        <div>
                 <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
     
                 <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
                        <ContentTemplate>
                               <CKEditor:CKEditorControl ID="CKEditorEdit" Height="300px" Toolbar="Full" ToolbarCanCollapse="false" HtmlEncodeOutput="true" runat="server">
                               </CKEditor:CKEditorControl>
                        </ContentTemplate>
                 </asp:UpdatePanel>
     
                 <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server">
                        <ContentTemplate>
                               <asp:Button ID="BtnUpload" Text="Toevoegen" ToolTip="Afbeeldingen toevoegen" runat="server" />
     
                               <CuteWebUI:Uploader ID="Uploader" runat="server"
                                      InsertButtonID="BtnUpload" InsertButtonStyle-CssClass="button"
                                      AutoUseSystemTempFolder="false" UploadType="Silverlight" ProgressLabelStyle-BackColor="White"
                                      ManualStartUpload="false"
                                      NumFilesShowCancelAll="10000" ShowProgressBar="false" ShowProgressInfo="false"
                                      MultipleFilesUpload="true" 
                                      ProgressTextTemplate="Voortgang: %P%. Resterende tijd: %T% seconden.">
         
                                      <ValidateOption AllowedFileExtensions="bmp,tif,gif,jpg,jpeg,png" />
                               </CuteWebUI:Uploader>
                        </ContentTemplate>
                 </asp:UpdatePanel>
        </div>
        </form>
    </body>
    </html>
     
    CODE BEHIND:
     
    Public Class test
           Inherits System.Web.UI.Page
     
           Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
                 If Not IsPostBack Then
                        Me.CKEditorEdit.Text = "<h1>hello</h1>"
                 End If
           End Sub
     
    End Class
     
     
  •  08-10-2011, 7:00 AM 69481 in reply to 69466

    Re: Uploader together with CKEditor both in updatepanel

    Hi dvanmaanen ,
     
    If you using .net framework 4.0, please try the setting below in your web.config
     
    <httpRuntime requestValidationMode=″2.0″ />
     
    Regards,
     
    ken
View as RSS news feed in XML