When Inserting a Template the Image source is incorrect

Last post 09-06-2006, 3:55 PM by ithandyman. 6 replies.
Sort Posts: Previous Next
  •  09-04-2006, 10:20 PM 22335

    When Inserting a Template the Image source is incorrect

    The template that I am inserting into CuteEditor contains the following tag:
     
    <img src="header.jpg">
     
    When I insert the template my tag looks like:
     
    <img src="http://localhost:1301/WebUI/CuteSoft_Client/CuteEditor/Dialogs/header.jpg">
     
    I want this URL to be:
     
    <img src="http://my.website.com/a/1234/header.jpg">
     
    Below is current code. My Page_Load code is:
     
    txtMessage.BaseHref = ConfigurationManager.AppSettings["WebUIURL"] + "a/" + Session["AccountID"].ToString();
    txtMessage.RemoveServerNamesFromUrl =
    false;
    txtMessage.UseRelativeLinks =
    false;
    txtMessage.SetSecurityGalleryPath(
    ConfigurationManager.AppSettings["WebUIURL"] + "a/" + Session["AccountID"].ToString());
     
     My web.config contains:

    <appSettings>
          
    <add key="WebUIURL" value="http://my.website.com/"/>
    </appSettings>

    I am using Visual Studio 2005 with CuteEditor.NET. I have been fighting this for days now and can not figure it out. Thanks in advance for your help.
     
  •  09-05-2006, 1:27 PM 22359 in reply to 22335

    Re: When Inserting a Template the Image source is incorrect

    ithandyman,
     
    Please download
     
     
     
    And after extract the zip file and overwrite the existing file with this one.
     
    Keep me posted.
     
     

    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

  •  09-05-2006, 2:59 PM 22368 in reply to 22359

    Re: When Inserting a Template the Image source is incorrect

    Thanks Adam for the response.
     
    Ok, this seems to work if everything is in the path provided above but it does not work if it is in subdirectory under this folder.
     
    Here is what I am doing:
     
    1. Click Insert Template. (The folder location comes up correctly)
    2. Click on a folder.
    3. Select the HTML file. (The image does not appear correctly in the Preview pane)
    4. Click OK.
     
    At this point the URL in CuteEditor reads:
     
    <img src="http://my.website.com/a/1234/header.jpg">
     
    It should be:
     
    <img src="http://my.website.com/a/1234/myfolder/header.jpg">

    Thanks in advance.
    (BTW, do you know that Select Tags on your AddPost.aspx does not work correctly. Dialog come up but then it never updates the Tags.)
  •  09-06-2006, 2:59 PM 22449 in reply to 22368

    Re: When Inserting a Template the Image source is incorrect

    Adam,
     
    Is there a simple change that I can make to get this to do what I want? I have been messing aroudnn with this for a while now and I am not sure what to do next with this. I am also getthing an error in the following method of InsertTemplate.frame.aspx:
     
    protected override void InitOfType()

    {
          fs.VirtualRoot=CuteEditor.
    EditorUtility.ProcessWebPath(Context,null,secset.TemplateGalleryPath).TrimEnd('/')+"/";
    }

    TemplateGalleryPath is ending up with a value like "/http://mywebsite.com/a/1234/" and throws an error "not a valid virtual path".
     
    Thanks in advance.
  •  09-06-2006, 3:33 PM 22457 in reply to 22449

    Re: When Inserting a Template the Image source is incorrect

    ithandyman:
    TemplateGalleryPath is ending up with a value like "/http://mywebsite.com/a/1234/" and throws an error "not a valid virtual path".
     
     
    ithandyman,
     
    TemplateGalleryPath must be a valid virtual path.
     
     
     

    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

  •  09-06-2006, 3:41 PM 22458 in reply to 22368

    Re: When Inserting a Template the Image source is incorrect

    ithandyman,
     
    No matter where you store the template, your template still contains the same HTML code:

    <img src="header.jpg">
     
    It's a relative path. Only if the page which contains the image locates in the same folder as this image, the image will be visible.
     
     

    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

  •  09-06-2006, 3:55 PM 22461 in reply to 22458

    Re: When Inserting a Template the Image source is incorrect

    I understand that it is relative reference. The issue that I am having is inserting template from a subfolder. If the template has a relative path such as src="header.jpg" the path ends up being "/a/1234/header.jpg" and not "/a/1234/myfolder/header.jpg" (which is the folder containing the template selected) even though the template and image are located in the same physical folder.
     
    Does this make sense? Thanks for your assistance.
View as RSS news feed in XML