开发者

deploying silverlight

开发者 https://www.devze.com 2023-01-21 13:25 出处:网络
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

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 websi开发者_开发百科te" Is that required if i want to put my aplicaion on the internet.


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>


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消