Re: opening create template on button click--Object reference not set to an instance of an object

  •  05-11-2010, 12:05 PM

    Re: opening create template on button click--Object reference not set to an instance of an object

    I have tested ken's code, it works.
     

    <%@ Page Language="C#" ValidateRequest="false" %>  
     
    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %> 

    <html>  
    <head>  
    </head>  
    <body>  
        <form id="Form1" runat="server">  
       <CE:Editor ID="editor1" runat="server">
        </CE:Editor>  
         
           <asp:Button ID="button1" runat="server" Text="Open Template" OnClientClick="openTemplate();return false" />      </form>  
    </body>  
    </html>  
     
    <script>
    var editor1 = document.getElementById("<%= editor1.ClientID %>");  
    function openTemplate()  
    {  
    editor1.ExecCommand("InsertTemplate");
    }  
    </script> 

    Please check whether the value of ID is same as the value of script
     <CE:Editor ID="editor1" runat="server">
        </CE:Editor>  
     
    Regards,
    Eric
View Complete Thread