Results 1 to 1 of 1

Thread: silverlight object is not obeying base href url

  1. #1
    jeffmaze Guest

    Angry silverlight object is not obeying base href url

    I'm having trouble getting my silverlight object to render on my page under the following conditions.

    My page has a base href set to the root of my site i.e. "http://localhost/".

    My page is in a folder like "http://localhost/samples/"

    My silverlight object lives in a folder off the root of my site "http://localhost/files/test.xap"

    The source URL to my silverlight file is relative to the base url i.e. "files/test.xap"

    The silverlight object seems make the source url relative to the url in the address bar rather than the base url set using the <base> tag.

    Is there something I can do to get my silverlight objects to render using the relative url to the base href?

    Here is some sample html of what works and what does not.
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> <html lang="EN-US" xmlns="http://www.w3.org/1999/xhtml"> 
    <head>
    
    <title>Silverlight Relative URL Test</title>
    
    <base href="http://localhost/" />
    
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> </head> 
    <body>
    
    <div>URL Relative to base does not work i.e. "files/test.xap"</div>
    
    <object style="width: 200px; height: 100px;" data="data:application/x-silverlight-2," type="application/x-silverlight-2">
    
    <param name="Source" value="files/test.xap" />
    
    </object>
    
    <div>URL Relative to Web Root works i.e. "/files/test.xap"</div>
    
    <object style="width: 200px; height: 100px;" data="data:application/x-silverlight-2," type="application/x-silverlight-2">
    
    <param name="Source" value="/files/test.xap" />
    
    </object>
    
    <div>URL Relative to Browser Address Bar works i.e. "../files/test.xap"</div>
    
    <object style="width: 200px; height: 100px;" data="data:application/x-silverlight-2," type="application/x-silverlight-2">
    
    <param name="Source" value="../files/test.xap" />
    
    </object> </body> 
    </html>
    Last edited by is_numeric; 04 Apr 2010 at 03:19 AM. Reason: codetags added

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •