Possible to use Image Gallery and Image Upload without Cute Editor?

Last post 06-17-2009, 9:02 PM by debierman. 2 replies.
Sort Posts: Previous Next
  •  06-16-2009, 11:50 PM 53194

    Possible to use Image Gallery and Image Upload without Cute Editor?

    I have a page where I am using Cute Editor to update html on a page. I have now been asked to also provide a way for a user to browse the upload gallery, upload images, resize and edit images and then place the url path into a text field where I will write this path into the database when I post the page.
     
    Is it possible to use Cute Editor in this way? Currently, I have them accessing the gallery a screen down the page only to access the gallery to do this. They then copy and paste the file path into the text field so that I can write the url into the database.
     
     
    Any help would be great.
     
    thanks!
    Derek
  •  06-17-2009, 2:48 AM 53201 in reply to 53194

    Re: Possible to use Image Gallery and Image Upload without Cute Editor?

    Hi debierman,
     
    Try this example
     
    1. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>   
    2.   
    3. <%@ Page Language="C#" %>   
    4.   
    5. <html>   
    6. <head>   
    7.     <title>ASP and ASP.NET WYSIWYG Editor - Use CuteEditor as an image selector</title>   
    8. </head>   
    9. <body>   
    10.     <form runat="server">   
    11.         <table border="0" cellpadding="0" cellspacing="0">   
    12.             <tr>   
    13.                 <td width="10" nowrap>   
    14.                 </td>   
    15.                 <td width="20" nowrap>   
    16.                 </td>   
    17.                 <td valign="top" width="760">   
    18.                     <b>Use CuteEditor as an image selector</b>   
    19.                     <hr>   
    20.                     This example demonstrates how to use CuteEditor as an image selector.   
    21.                     <br>   
    22.                     <br>   
    23.                     <asp:TextBox ID="imageFld" Width="300" runat="server" />   
    24.                     <input type="button" value="Change Image" onclick="callInsertImage()" id="Change"  
    25.                         runat="server" name="Change">   
    26.                     <div>   
    27.                         <CE:Editor ID="Editor1" runat="server" Width="1" Height="1" AutoConfigure="None"  
    28.                             ShowHtmlMode="False" ShowPreviewMode="False" EnableContextMenu="false" ShowGroupMenuImage="False"  
    29.                             ShowBottomBar="False" BackColor="White" BorderColor="White">   
    30.                         </CE:Editor>   
    31.                         <br>   
    32.                     </div>   
    33.                 </td>   
    34.                 <tr>   
    35.                 </tr>   
    36.         </table>   
    37.     </form>   
    38.   
    39.     <script language="javascript">    
    40.     function callInsertImage()     
    41.     {     
    42.             var editor1 = document.getElementById('<%=Editor1.ClientID%>');   
    43.             editor1.FocusDocument();     
    44.             var editdoc = editor1.GetDocument();     
    45.             editor1.ExecCommand('new');   
    46.             editor1.ExecCommand('InsertImage');   
    47.             InputURL();   
    48.     }       
    49.        
    50.     function InputURL()   
    51.     {    
    52.         var editor1 = document.getElementById('<%=Editor1.ClientID%>');   
    53.         var editdoc = editor1.GetDocument();     
    54.         var imgs = editdoc.images;   
    55.         if(imgs.length>0)     
    56.         {   document.getElementById("imageFld").value = imgs[imgs.length-1].src;   
    57.             editor1.ExecCommand('new');   
    58.             document.getElementById("imageFld").focus();    
    59.         }     
    60.         else  
    61.         {   
    62.             setTimeout(InputURL,500);    
    63.         }     
    64.     }          
    65.     </script>   
    66.   
    67. </body>   
    68. </html>  

    Regards,
     
    Ken
  •  06-17-2009, 9:02 PM 53235 in reply to 53201

    Re: Possible to use Image Gallery and Image Upload without Cute Editor?

    This worked perfectly. Thanks Ken!
View as RSS news feed in XML