Skip to main content

Microsoft Silverlight

Answered Question Silverlight Source cannot be fully qualified URLRSS Feed

(0)

yvesc
yvesc

Member

Member

20 points

16 Posts

Silverlight Source cannot be fully qualified URL

I am trying to dynamically load an xap from a fully qualified URL instead of ClientBin but, although the documentation for the System.Web.UI.SilverlightControls.Silverlight class says "Use the Source property to specify the URL of the XAML source file or XAP source package.", I get a 404 error. Not sure if it's a bug or by design though. However it would be really nice to be able do this:

Imagine multiple web applications that have a different look and feel but you want to provide some common pages to all of them; using Silverlight would solve the presentation problem; then once you have the result in the Silverlight component, you can pass them to your calling page via the DOM.

Here is the code that works:

            System.Web.UI.SilverlightControls.Silverlight sl = new System.Web.UI.SilverlightControls.Silverlight();
            sl.Source = "ClientBin/CommonVehicleSilverlight.xap";
            sl.ID = "CommonVehicleSilverlight";
            sl.Width = new Unit(800); sl.Height = new Unit(600);
            sl.Windowless = true;
            SilverlightApp.Controls.Clear();
            SilverlightApp.Controls.Add(sl);


If I replace line two by this, I get a 404: 

    sl.Source = "http://localhost/SilverlightApplication20/ClientBin/CommonVehicleSilverlight.xap";

I get a 404 from the browser as well even when I try to open it from IIS so I know I don't have any path resolution issue (the page is found if I change the extension). I tried to put a ".xap" application extension in IIS but I am not sure what executable I could use (assuming this would solve the problem).

I forgot to mention that this occurs when the 2 applications are in 2 different domains. It works if I use the same domain.

Would love to hear from the developement team to confirm if it is a bug or a "feature". 

Thanks, Yves

preishuber
preishuber

Contributor

Contributor

3570 points

655 Posts

Answered Question

Re: Silverlight Source cannot be fully qualified URL

if you can not download the xap in browser it can be a problem of missing mime type

add in iis the extension and set the type to application/x-silverlight-app

-Hannes

http://www.preishuber.net http://weblogs.asp.net/hpreishuber

yvesc
yvesc

Member

Member

20 points

16 Posts

Re: Silverlight Source cannot be fully qualified URL

Yes, Hannes, this did the trick. Why didn't I think of thisWink?

Thanks a lot!

Yves

yvesc
yvesc

Member

Member

20 points

16 Posts

Re: Silverlight Source cannot be fully qualified URL

Hannes, I tried to mark your post as answer but it did not work for some reason. You might want to try this.

Thanks again, Yves

a2005
a2005

Member

Member

37 points

39 Posts

Re: Silverlight Source cannot be fully qualified URL

Does not work for me. I have IIS 7 where I have defined mime type for XAP To test if URL access issues, I tried "http://localhost/ClientBin/Test.xap". The browser (IE7) pops up "Save As" dialog. In the test page (generated by VS2008), I replace the source URL with above. It does not show anything.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities