开发者

host the silverlight application in a new website(default.aspx)

when I create new silverlight project it asks Host the Silverlight application in a new Website followed by two fields- 1. Name: projectName.web 2. Type: ASP.Net Web Appl开发者_运维技巧ication Project OR Asp.Net Web Site when I uncheck this checkbox VS doen not create projectName.web project but when I check this VS creates two projects 1. projectName-->contains .xaml pages 2. projectName.web--> contains default.aspx page.................. So my question is - Is it must to host silverlight app from a new website(default.aspx page) OR cant we directly host .xaml page? ProjectName.Web project is req.??


you must host xap file on a web page (aspx or html). here is the html markup for that

    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
      <param name="source" value="mySilverlightFile.xap"/>
      <param name="onError" value="onSilverlightError" />
      <param name="background" value="white" />
      <param name="minRuntimeVersion" value="3.0.40624.0" />
      <param name="autoUpgrade" value="true" />
      <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
          <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
      </a>
    </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>


Actually you can't run xap directly from browser. But once you refer your xap file as an object element in you html Silverlight runtine on your client machine get recognize the extension and start a sandbox to host your xbap app in it.

Xap in it self is nothing but a archived assembly which contains all you Silverlight code and assets you included in it.

More details are on: http://forums.silverlight.net/forums/p/166495/378292.aspx

Regards.


XAML is the markup for defining Silverlight/WPF interfaces. It's not a page itself.

If you want to host a Silverlight application on the web, the application needs to be placed on a page so it can be served to end users.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜