Modifying EditorBodyStyle Programatically

Last post 06-27-2009, 11:08 AM by BazVoce. 2 replies.
Sort Posts: Previous Next
  •  06-25-2009, 2:48 PM 53538

    Modifying EditorBodyStyle Programatically

    Hi There,
     
    I have a site where the users can update the content using Cute Editor. Some of the content is rendered over a background image. I set the Cute Editor properties as follows :

    string s_SourceFile = Server.MapPath(dr.GetString(8).Trim());

    Editor1.EditorBodyStyle = "font:normal 10pt verdana; color: " + dr.GetString(9).Trim() + "; background-image:url('" + s_SourceFile + "'); background-repeat:no-repeat; background-position: left; padding: 10px;";

    dr.GetString(8) will be in the format of "~/Images/Waterways/mooring.jpg"                  

    The variables are retreived from a database and on my local machine it works fine, but when I upload it to the server no image appears, although the font colors do behave as expected.
     
    Could anyone help?
  •  06-25-2009, 4:40 PM 53541 in reply to 53538

    Re: Modifying EditorBodyStyle Programatically

    BazVoce,
     
    If you remove s_SourceFile and add an Image URL (You need to make sure it is correct), will it work?

    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

  •  06-27-2009, 11:08 AM 53571 in reply to 53541

    Re: Modifying EditorBodyStyle Programatically

    Hi Adam,
     
    I've now discovered that by using "../Images/Waterways/mooring.jpg"  instead of "~/Images/Waterways/mooring.jpg" it now works fine on the server( without using Server.Mappath()).
     
    Thanks for pointing me in the right direction.
     
View as RSS news feed in XML