简体   繁体   中英

deploying silverlight

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM