Relative vs. Absolute Paths with Images

Last post 07-13-2006, 5:49 AM by the4bs. 2 replies.
Sort Posts: Previous Next
  •  07-12-2006, 8:20 AM 20924

    Relative vs. Absolute Paths with Images

    I have a situation where I have a popup page that does a search for images - see picture below.
    The results are returned with a link button below.
    The link button has the following code attached to it in the code behind page:
     
    OnClientClick = "PasteHTML('<img src =../filemanager/previewfile.ashx?id=" & e.Item.DataItem("FileID") >')"

    On clicking the link button, the image is inserted into the editor - see picture below.
     
    The problem I have is that if the editor is in  Normal view is inserts:
    <img src="http://localhost:2192/acms2Web/filemanager/previewfile.ashx?id=180137>
     
    If the editor is in  HTML view it inserts:
    <img src="../filemanager/previewfile.ashx?id=180137> *This is what I want all the time*
     
    Using:
    UseRelativeLinks = "True" RemoveServerNamesFromUrl = "True" does not make any difference.


    Why does this happen?

    Why does the editor change my html from the OnClientClick?

    Can anything be done to ensure I get a relative link in all cases?
     
  •  07-12-2006, 7:03 PM 20948 in reply to 20924

    Re: Relative vs. Absolute Paths with Images

    the4bs,
     
    Please make sure you are using the latest build of the version 5.3.
     
     
    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

  •  07-13-2006, 5:49 AM 20958 in reply to 20924

    Re: Relative vs. Absolute Paths with Images

    Thank you for the reply.
     
    Updating the editor to latest version didn't solve my problem.
     
    However, I did solve it by changing my code slightly from:
     
    OnClientClick = "PasteHTML('<img src =../filemanager/previewfile.ashx?id=" & e.Item.DataItem("FileID") >')"
    to
    OnClientClick = "PasteHTML('<img src =""../filemanager/previewfile.ashx?id=" & e.Item.DataItem("FileID") & """>')"
View as RSS news feed in XML