Relative vs. Absolute Paths with Images

  •  07-12-2006, 8:20 AM

    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?
     
View Complete Thread