getting the content of Editor1.Text; blank

Last post 05-05-2010, 12:40 AM by svk. 8 replies.
Sort Posts: Previous Next
  •  04-26-2010, 5:04 AM 60400

    getting the content of Editor1.Text; blank

    i am using the editor fr emaling
    but i am getting the Editor1.Text blank
    i dont get any error msg
    but i dont the the typed contents

     
  •  04-26-2010, 8:36 AM 60402 in reply to 60400

    Re: getting the content of Editor1.Text; blank

    Dear svk,
     
    Can you post your code here?
     
    Regards,
    Eric
  •  04-27-2010, 12:30 AM 60437 in reply to 60402

    Re: getting the content of Editor1.Text; blank

    <script type="text/javascript">
          
           function getHTML()
    {
      
        var editor1 = document.getElementById('<%=Editor1.ClientID%>');
        document.getElementById("txtmatter").value = editor1.getHTML();
         alert(document.getElementById("txtmatter").value)

        </script>


    <script runat="server">
      
       
        Protected Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
            Try
           
                If txtSubject.Text = "" Then
                    lblmsg.Visible = True
                    lblmsg.Text = "Subject Cannot be blank"
                    btnSend.Enabled = False

                    Exit Sub
                End If
                btnSend.Enabled = True
                frmemail =frmemail
                subject = txtSubject.Text

    dim matter= txtmatter.value
                cc = ""
                bcc = ""
                msg = ""
                msg = msg + Editor1.Text    -------------------------- i get this blank
                msg = msg + "<br/><br/><br/><br/>"
                msg = msg + lbldis.Text

    ............. coding for mail sending

     Catch ex As Exception
       
            Finally

            End Try
        End Sub

    i even tried with  javascripting to assign the editor value to hidden textbox
    i get the contents in the alert but i get the varibale matter =""

    i need to contents of teh ediotor on the server side so that the matter cam be emailed

  •  04-27-2010, 12:12 PM 60465 in reply to 60437

    Re: getting the content of Editor1.Text; blank

    Dear svk,
     
    Please refer to http://www.richtextbox.com/vb/Edithtml.aspx, you can find its source code in download package, it shows you how to get the content of editor.
     
    Regards,
    Eric
  •  04-29-2010, 2:58 AM 60533 in reply to 60465

    Re: getting the content of Editor1.Text; blank

    hello eric
     
    i checked everything and found out few things that my alead to the error
    i get the below error when i compile the application
     
    Warning 1 Generation of designer file failed: Unknown server tag 'CE:Editor'. 
     
    the editor works fine with inline coding ie using script runat server tag
    but the prblm is some how the mail is not getting sent
    but id i use the code behind i get the same error as editor1 is not defined as i found that in the dsigner file the editor is not getting  created like
    Protected WithEvents btnUpdate As Global.System.Web.UI.WebControls.Button
    so may be as the editor is not getting rreferenced in the designer file its giving undefined error
    i tried to add the above line manually as
    Protected WithEvents Editor1 As cuteeditor
    but after  'as ' i get no namespace related to cuteeditor for referencing
    do i  need to reference the DLL in the project , its in bin folder at present
     
    somehow i need to have the coding in code behind , but i feel the editor is not getting created in the designer so the error
    how do i solve it
    i tired making getcontents and adding the cod eu have given
    it too showed the same
    the designer was empty and showed me
    Warning 1 Generation of designer file failed: Unknown server tag 'CE:Editor'.  and in code nedhind gave me editor1 not defined
  •  04-30-2010, 12:01 PM 60575 in reply to 60533

    Re: getting the content of Editor1.Text; blank

    Please follow steps in http://cutesoft.net/developer+guide/scr/Adding-CuteEditor-to-Visual-Studio-2008-Toolbox.htm , drag cuteeditor to your page, and then test it again.
     
    Regards,
    Eric
     
     
  •  05-03-2010, 10:31 PM 60652 in reply to 60575

    Re: getting the content of Editor1.Text; blank

    Hello eric that was nice.sorry if get in to this for both you i just have the same problem. sorry again and hope you can forgive me.
     
     
     
     
     
     
     
     

    atec hitting streak

    pitching machine
  •  05-04-2010, 2:21 AM 60658 in reply to 60652

    Re: getting the content of Editor1.Text; blank

    Hi svk and sade1125,
     
    Try the example below
     
    1. <%@ Page Language="VB" ValidateRequest="false"%>   
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>   
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    5.   
    6. <script runat="server">   
    7.   
    8.     Protected Sub button1_Click(ByVal sender As ObjectByVal e As System.EventArgs)   
    9.         Dim editorText = tbServer.Text   
    10.         label1.Text = editorText   
    11.     End Sub  
    12. </script>   
    13.   
    14. <html xmlns="http://www.w3.org/1999/xhtml">   
    15. <head runat="server">   
    16.     <title>Untitled Page</title>   
    17. </head>   
    18. <body>   
    19.     <form id="form1" runat="server">   
    20.         <div>   
    21.             <CE:Editor ID="editor1" runat="server">   
    22.             </CE:Editor>   
    23.             <asp:Button ID="button1" runat="server" Text="Get editor text" OnClientClick="GetEditorText()" OnClick="button1_Click" /><br />   
    24.             <asp:TextBox ID="tbServer" runat="server"></asp:TextBox>   
    25.             <asp:Label ID="label1" runat="server"></asp:Label>   
    26.         </div>   
    27.     </form>   
    28. </body>   
    29. </html>   
    30.   
    31. <script>   
    32. var editor1=document.getElementById("<%= editor1.ClientID %>");   
    33. var tbServer=document.getElementById("<%= tbServer.ClientID %>");   
    34.   
    35. function GetEditorText()   
    36. {   
    37. tbServer.value=editor1.getHTML();   
    38.   
    39. }   
    40. </script>  
    Regards,
     
    ken
  •  05-05-2010, 12:40 AM 60696 in reply to 60652

    Re: getting the content of Editor1.Text; blank

    thnks i got i t already
    the prblm was the editor dll was not referenced in th eproject
    after i referenecd it i got it working
View as RSS news feed in XML