This is a migrated thread and some comments may be shown as answers.

silverlight objects do not obey base href value

1 Answer 15 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alan Gerling
Top achievements
Rank 1
Alan Gerling asked on 02 Apr 2010, 07:30 AM

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.

<!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>

1 Answer, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 07 Apr 2010, 07:32 PM
Hello Alan,

Thank you for contacting us.

Indeed the "<base href="..."/> is not respected by Silverlight plug-in. As a small demonstration you can try the attached example. Note that both asp-hyperlinks are redirected correctly to the base-href address, while the Silverlight source is searched against the hosting page.

We hope this information will help you.


Sincerely yours,
Ivan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Alan Gerling
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Share this question
or