HtmlEditor Post Problem

  1. #1

    HtmlEditor Post Problem

    Hi,
    I have a problem with HtmlEditor value POST.

    I had search on forum and found topic.. (http://forums.ext.net/showthread.php?1334) for exmple this.. and everywhere written it must work.. but

    When I set

    <pages validateRequest="false"> in Webconfig.. or on the page to false - then HtmlEditor value empty.

    When I make it true - then I have Internal Server Error 500. In the topic link before Vlad wrote the source code mode need to switch from "Source" to Standard.. what it means? just switch aspx page to design mode? - It does not help me also, but probably I don't understand exact the sentence.

    Any help
    Thanks!
    Last edited by geoffrey.mcgill; Feb 20, 2011 at 1:17 PM.
  2. #2

    RE: HtmlEditor Post Problem

    Hi,

    I think it is better to post example which demonsrates the problem. It helps us to undersdtand the problem and forces an answer
     
    Vladimir Shcheglov
    Sr. Developer
  3. #3

    RE: HtmlEditor Post Problem



    Hi Vladimir,

    Here is a control look for Id cmdSend

    
    <%@ Control Language="VB" AutoEventWireup="false" CodeFile="AnotoViewer.ascx.vb" Inherits="AnotoViewer" Debug="true" %>
    
    <%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>
    
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    <link href="Css/AnotoViewer.css" rel="stylesheet" type="text/css" />
    
       
    
        <script src="Js/AnotoViewer.js" type="text/javascript"></script>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    <ext:Toolbar ID="Toolbar1" runat="server" IDMode="Legacy" Height="28px">
                 <Items>
                 
                            <ext:ToolbarButton ID="Toolbar_cmdAA" runat="server" StandOut="true" 
                               Text="A / A" Icon="LayoutEdit" IconCls="icon-layoutedit">
                                <Listeners>
                                    <Click Handler="DisplayDocumentImageWithControls();" />                                
                                </Listeners>
                            </ext:ToolbarButton>
                           <ext:ToolbarButton ID="Toolbar_cmdA_" runat="server" StandOut="true" 
                               Text="A / " Icon="Layout" IconCls="icon-layout">
                                <Listeners>
                                    <Click Handler="DisplayFormularImageWithControls();" />                                
                                </Listeners>
                            </ext:ToolbarButton>
                           <ext:ToolbarButton ID="Toolbar_cmd_A" runat="server" StandOut="true" 
                               Text=" / A" Icon="LayoutDelete" IconCls="icon-layoutdelete">
                                <Listeners>
                                    <Click Handler="DisplayDocumentImageWithoutControls();" />                                
                                </Listeners>
                            </ext:ToolbarButton>          
                           <ext:ToolbarButton ID="Toolbar_cmdSendEmail" runat="server" StandOut="true" 
                               Text="Send Email" Icon="Mail" IconCls="icon-mail">
                                <Listeners>
                                <Click Handler="SaveXMLDocument();" />
                                </Listeners>
                                <AjaxEvents>
                                <Click OnEvent="mmks_displayemail"></Click>
                                </AjaxEvents>
                            </ext:ToolbarButton>        
                           <ext:ToolbarButton ID="Toolbar_cmdSave" runat="server" StandOut="true" 
                               Text="Save" Icon="Disk" IconCls="icon-disk">
                                <Listeners>
                                    <Click Handler="SaveXMLDocument();" />                                
                                </Listeners>
                                <AjaxEvents>
                                <Click OnEvent="cmdSave_Click"></Click>
                                </AjaxEvents>
                            </ext:ToolbarButton>         
                 
                 </Items>
             </ext:Toolbar>
          
                <div runat="server" id="AnotoViewerControl">
                  <asp:ImageMap ID="imgFormular" runat="server" EnableViewState="False">
                  </asp:ImageMap>
                
    
            
        <asp:HiddenField ID="txtFormValues" runat="server" />
        <asp:HiddenField ID="txtWordSelected" runat="server" />
        <asp:HiddenField ID="txtFocusControl" runat="server" />
        <asp:HiddenField ID="txtCurrentPage" runat="server" Value="1" />    
          
        
    
    
    <ext:Window ID="Window1" 
            runat="server" 
                Collapsible="true" 
                Icon="Application" 
                AutoHeight="true" Modal="true" Show&#111;nload="false"
            Title="New Email" Width="643px">
            <Body>
            <ext:Toolbar ID="Toolbar_Email" runat="server" IDMode="Legacy" Height="28px">
                 <Items>
                 <ext:ToolbarFill />
                            <ext:ToolbarButton ID="ToolbarButton_PdfAttachment" runat="server"  
                               Text="Pdf document" Icon="PageWhiteAcrobat" 
                         IconCls="icon-pagewhiteacrobat">
                         <AjaxEvents>
                         <Click OnEvent="mmks_displaypdf"></Click>
                         </AjaxEvents>
                            </ext:ToolbarButton>
                           <ext:ToolbarButton 
                            ID="ToolbarButton_XmlAttachment" 
                                runat="server" 
                                Text="Xml document" 
                                Icon="PageWhiteWorld" 
                                IconCls="icon-pagewhiteworld">
                            <AjaxEvents>
                            <Click OnEvent="mmks_displayxml"></Click>
                            </AjaxEvents>
                            </ext:ToolbarButton>
                 </Items>
                 </ext:Toolbar>        
                <ext:Panel 
                ID="Panel_Email"
                runat="server" 
                Frame="true"
                BodyStyle="padding:5px 5px 0;" 
                AutoWidth="true" 
                AutoHeight="true"
                ButtonAlign="Center">
                <Body>
                    <ext:Panel ID="Panel_EmailHeader" runat="server" AutoWidth="true">
                        <Body>
    
                                    <ext:Panel ID="Panel_EmailAddress" runat="server" Border="false" Header="false">
                                        <Body>
                                            <ext:FormLayout ID="FormLayout_EmailAddress" runat="server" LabelAlign="Left">
                                                <ext:Anchor Horizontal="95%">
                                                    <ext:TextField ID="txtTo" runat="server" FieldLabel="To" />
                                                </ext:Anchor>
                                                <ext:Anchor Horizontal="95%">
                                                    <ext:TextField ID="txtCC" runat="server" FieldLabel="CC" />
                                                </ext:Anchor>
                                                <ext:Anchor Horizontal="95%">
                                                    <ext:TextField ID="txtSubject" runat="server" FieldLabel="Subject" />
                                                </ext:Anchor>
                                            </ext:FormLayout>
                                        </Body>
                                    </ext:Panel>
                                    
                        </Body>
                    </ext:Panel>
                    <ext:Panel ID="Panel_HtmlEditor" runat="server">
                        <Body>
                            <ext:FormLayout ID="FormLayout_HtmlEditor" runat="server" LabelAlign="Top">
                                <ext:Anchor Horizontal="98%">
                                    <ext:HtmlEditor ID="HtmlEditor1" runat="server" Height="200" FieldLabel="Body"  EnableViewState="False" />
                                </ext:Anchor>
                            </ext:FormLayout>
                        </Body>
                    </ext:Panel>
                </Body>
                <Buttons>
                    <ext:Button ID="cmdSend" runat="server" Text="Send">
                    <AjaxEvents>
                    <Click OnEvent="mmks_SendEmail">
                     <EventMask ShowMask="true" Msg="Sending..."/>
                    </Click>
                    </AjaxEvents>
                    </ext:Button>
                    
                    <ext:Button ID="cmdCancel" runat="server" Text="Cancel">
                    <Listeners>
                        <Click Handler="#{Window1}.hide();" />
                    </Listeners>                
                    </ext:Button>
                </Buttons>
            </ext:Panel>       
            
            </Body>
        </ext:Window>
    <ext:Window ID="Window_FileView"
            runat="server" 
            Show&#111;nload="false"
            Width = "700px"
            Height = "600px" 
            Collapsible = "true" >
                <AutoLoad Mode="IFrame" >
                </AutoLoad>
    </ext:Window>
            
     



    And here is little part of code withmmks_SendEmail

    HtmlEditor value and text is empty here.. and if I switch in WebConfig <pages validateRequest="true"> then Server Error happens.

    
    Protected Sub mmks_SendEmail(ByVal sender As Object, ByVal e As Coolite.Ext.Web.AjaxEventArgs)
    
      Dim lnId As String = Session("session_document_id")
            Dim lcClientId As String = Session("session_client_id")
    
            Dim loDataEngine As AnotoData
            loDataEngine = New AnotoData(Request.ApplicationPath)
            Dim lcSMTPServer As String = loDataEngine.GetGlobalOption("SMTP_SERVER")
            Dim lcLogin As String = loDataEngine.GetGlobalOption("SMTP_LOGIN")
            Dim lcPassword As String = loDataEngine.GetGlobalOption("SMTP_PASSWORD")
            Dim lcFromAddress As String = loDataEngine.GetGlobalOption("SMTP_FROM")
            Dim lcDefaultSubject As String = Me.txtSubject.Value
            Dim lcToAddress As String = Me.txtTo.Value
            Dim lcBody As String = HtmlEditor1.value
    
            Dim lcTmpPdf As String = mmks_createpdf()
            Dim lcTmpXML As String = mmks_createxml()
    
            If Not String.IsNullOrEmpty(lcToAddress) Then
                Dim loMail As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage(lcFromAddress, lcToAddress)
                loMail.Subject = lcDefaultSubject
                loMail.IsBodyHtml = True
                loMail.Body = lcBody
                loMail.Attachments.Add(New System.Net.Mail.Attachment(lcTmpPdf))
                loMail.Attachments.Add(New System.Net.Mail.Attachment(lcTmpXML))
                Dim loSMTP As SmtpClient = New System.Net.Mail.SmtpClient()
                loSMTP.Host = lcSMTPServer
                Dim loAuth As System.Net.NetworkCredential
                loAuth = New NetworkCredential()
                loAuth.UserName = lcLogin
                loAuth.Password = lcPassword
                loSMTP.Credentials = loAuth
                loSMTP.Send(loMail)
            End If
    
            Me.Window1.Hide()
    
    
    End Sub


    Thank you
  4. #4

    RE: HtmlEditor Post Problem

    Hi,

    Can you post simplified example which we can test. It is hard analyze piece of code only. We need example which we can run without adittional editing 
    Vladimir Shcheglov
    Sr. Developer
  5. #5

    RE: HtmlEditor Post Problem



    Hi Vladimir,

    The examples which I prepared for you to show the problem works perfect .. It help me found mistake in my private code.

    Thanks for attention.  
  6. #6

    RE: HtmlEditor Post Problem

    when you have a html editor, and have the validaterequest = true in the page directive or in the web.config. any entry in the html editor will cause an internal server error on submit. this only happens when the html editor is in source view, can we do anything about this?

Similar Threads

  1. Replies: 0
    Last Post: Aug 14, 2012, 2:54 PM
  2. Replies: 0
    Last Post: Aug 14, 2012, 2:48 PM
  3. Replies: 3
    Last Post: Jan 13, 2010, 3:07 AM
  4. Replies: 0
    Last Post: May 17, 2008, 5:29 PM

Posting Permissions