tags:

views:

20

answers:

2

Do i need to host silverlight onto a website before i can host it on the internet? For example when you first created a silverlight applciation, itll ask you to check "Host silverlight applcaition to a new website" Is that required if i want to put my aplicaion on the internet.

A: 

If you want your Silverlight application to be available on the Internet, it stands to reason that it needs to be hosted on a website somewhere. That doesn't mean it has to be the website created by Visual Studio though - that's just to get you started developing.

HTH,
Kent

Kent Boogaart
So i can leave "host silverlight in a new website" unchecked and just upload my xaml files to a web server? I dont have to go through the iis manager for this too right?
Yes, you can leave it unchecked if you don't need VS to generate a website for you (that's why it asks you). You'd be uploading XAP and an "entry-point" web page, not XAML files. Assuming you have access to a web server somewhere, then you could upload your bits to the appropriate locations and it should just work.
Kent Boogaart
A: 

For a Silverlight application to work on a website, you must host the .xap file inside a ASPX or HTML page with the following code inside the tag. Be sure to changed the source to the name of your .xap file.

    <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="ClientBin/whateveryoucalledit.xap"/>
      <param name="onError" value="onSilverlightError" />
      <param name="background" value="white" />
      <param name="minRuntimeVersion" value="4.0.50826.0" />
      <param name="autoUpgrade" value="true" />
      <a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=4.0.50826.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>
mbcrump