views:

405

answers:

3

I have a SL 3.0 xap I want to host in a ASP.NET website, I have access to the XAP file and I have created a HTML page to host the SL component.

When I access the page all I see is a white screen where the SL component should be, SL is loaded but the component is not displayed.

Any ideas why this is happening?

This is the HTML code for the SL div.

<body>
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
      <param name="source" value="http://lonmw32795/SliverlightRESTfulWebservice.Web/ClientBin/SliverlightRESTfulWebservice.xap"/&gt;
      <param name="onError" value="onSilverlightError" />
      <param name="background" value="white" />
      <param name="minRuntimeVersion" value="3.0.40818.0" />
      <param name="autoUpgrade" value="true" />
      <a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=3.0.40818.0" style="text-decoration:none">
          <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
      </a>
    </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
</form>

Cheers

AWC

+3  A: 

Watch out for javascript errors to give you more information.

Often the error is that the IIS is not configured to handle XAP files appropriately: Configuring IIS for Silverlight Applications

herzmeister der welten
I've added the MIME types and still no luck, the fact that I'm developing on XP and therefore IIS is 5.1 does this have any affect?
AWC
plus I'm not seeing any javascript errors being reported in the browser (IE 7.0)
AWC
Did you restart IIS/WWW publishing service after the changes?
herzmeister der welten
DOH! Homer Simpson moment - I should really learn to spell, you were right MIME types was the answer, thanks
AWC
A: 

Are you sure that you are not having Default.aspx as your startpage and that the SL object is inside one of the generated testpages?

xamlgeek
not really a helpful answer
AWC
A: 

I have seen this behavior when the app throws a XAML error. Take a look in App.xaml.cs and find Application_UnhandledException. To get you started just add a: MessageBox.Show(e.ExceptionObject.Message) in this method instead of writting to the DOM.

mraaskov