Can programmatically/dynamically set a background image for editor?

Last post 12-04-2008, 12:37 PM by Adam. 6 replies.
Sort Posts: Previous Next
  •  12-03-2008, 6:44 PM 46538

    Can programmatically/dynamically set a background image for editor?

    We would like to be able to associate (in advance) a separate background image with each specific 'page' of content that we want to display in the editor.   So, when a particular 'page' of content and a path to the background image file is retrieved from our database, that background image can be set for the editor and the content then displayed on top of it.  How can this be done with ASP.NET/VB.NET?   Thanks.
  •  12-03-2008, 6:53 PM 46539 in reply to 46538

    Re: Can programmatically/dynamically set a background image for editor?

  •  12-03-2008, 7:28 PM 46544 in reply to 46539

    Re: Can programmatically/dynamically set a background image for editor?

    I must be missing something basic:  how do I retrieve the source code for this page?   Also, what is the earliest version of the editor for which this technique is available?  Thanks.
  •  12-03-2008, 7:33 PM 46545 in reply to 46544

    Re: Can programmatically/dynamically set a background image for editor?

    In the download package, there is a file named Using-External-Style-Sheets.aspx.
     
    Here is the source code of this example:
     

    <%@ Page Language="C#"%>
    <%@ Register TagPrefix="cutesoft" TagName="banner" Src="banner.ascx" %>
    <%@ Register TagPrefix="cutesoft" TagName="leftmenu" Src="leftmenu.ascx" %>
    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>

    <html>
        <head>
      <title>ASP and ASP.NET WYSIWYG Editor - Using External Style Sheets </title>
      <link rel="stylesheet" href="../example.css" type="text/css" />
     </head>
     <body>
            <form runat="server">
       <cutesoft:banner id="banner1" runat="server" /> 
       <table>
        <tr>     
         <td valign="top" nowrap id="leftcolumn" width="160">
          <cutesoft:leftmenu id="leftmenu1" runat="server" />    
         </td>
         <td width="20" nowrap></td>
         <td valign="top" width="750">
          <h1>Using External Style Sheets </h1>
          With Cute Editor, you can specify the location of the style sheet that will be used by the editable area. Multiple Style Sheets are supported.
          <br><br>
          <asp:radiobuttonlist id="themeList" runat="server" autopostback="True" RepeatDirection="Horizontal" onselectedindexchanged="theme_Changed">
           <asp:ListItem value="../example.css"  Selected="True">example.css</asp:ListItem>
           <asp:ListItem value="blackbackground.css">blackbackground.css</asp:ListItem>
           <asp:ListItem value="../example.css,blackbackground.css">example.css+blackbackground.css</asp:ListItem>
          </asp:radiobuttonlist>
          <CE:Editor ThemeType="Office2007" id="Editor1" runat="server" Height="250" AutoConfigure="Simple"></CE:Editor>
          <br><br>
          <asp:Literal ID="Literal1" Runat="server" /> 
         </td>
        <tr>
       </table>   
      </form>
     </body>
    </html>

    <script runat="server">
     private void theme_Changed(Object sender, EventArgs e)
     {
      Editor1.EditorWysiwygModeCss  = themeList.SelectedItem.Value; 
     }
    </script>


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  12-04-2008, 11:02 AM 46577 in reply to 46545

    Re: Can programmatically/dynamically set a background image for editor?

    Got it.  To confirm, what is the earliest version of the editor for which this technique is available?  Thanks.
  •  12-04-2008, 11:07 AM 46578 in reply to 46577

    Re: Can programmatically/dynamically set a background image for editor?

    Can we just change the background image property dynamically, rather than having to apply a different css each time?   Or, alternatively, can we apply one css and just change the background image property of that css dynamically each time?    I'm not sure that it will be feasible for us to create a separate css file for each background image a customer may want to use, if I understand your code.   Thanks.
  •  12-04-2008, 12:37 PM 46588 in reply to 46578

    Re: Can programmatically/dynamically set a background image for editor?

    You can use Editor.EditorBodyStyle Property:

    Editor1.EditorBodyStyle="font-family: Verdana";

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML