我想在一個HTML頁面中包含一個Silverlight應用程序(.xap文件)。如何在帶有對象標籤的HTML頁面上包含Silverlight?
使用這些MSDN instructions我創建這個HTML頁面:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<title>Test Silverlight Page</title>
</head>
<body>
<object id="SilverlightPlugin1" width="300" height="300"
data="data:application/x-silverlight-2,"
type="application/x-silverlight-2" >
<param name="source" value="MultiplePages.xap"/>
<!-- Display installation image. -->
<a href="http://go.microsoft.com/fwlink/?LinkID=124807"
style="text-decoration: none;">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181"
alt="Get Microsoft Silverlight"
style="border-style: none"/>
</a>
</object>
</body>
</html>
,但是當我在Firefox瀏覽它,我得到一個彈出窗口,詢問我是否要運行.xap文件:
alt text http://tanguay.info/web/external/silverlightPopup.png
需要使用什麼HTML /對象代碼才能使Silverlight應用程序在瀏覽器內運行,而不是瀏覽器要求執行它?
感謝,這是我安裝Visual Web開發人員和混合我的研究與開發機,不知道爲什麼它會這樣做,無論如何,在其他機器上嘗試過它,它可以工作,例如:http://tanguay.info/web/examples/silverlightInfoFlip – 2009-02-02 05:40:48