在 VS 2005 中运行 xap(silverlight 应用程序)
我在 vs 2008 中编写了一个小型 silverlight
应用程序。现在我想将该应用程序插入到使用 vs.net 2005 开发的网站中。执行此操作需要执行哪些步骤。 这就是我到目前为止所做的。
在 web.config 中
<compilation debug="true" strict="false" explicit="true">
<assemblies>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.SilverlightControls" assembly="System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
在 asp 页面中。
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI.SilverlightControls" Assembly="System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<body>
<form id="form1" runat="server">
<div>
Silverlight Test
<asp:ScriptManager ID="scriptManager" runat="server" />
<div style="height: 100%;">
<asp:Silverlight ID="silverlightControl" runat="server" Source="~/TypingTestV2.xap"
MinimumVersion="2.0.31005.0" Width="100%" Height="100%" />
</div>
</div>
</form>
当我运行该应用程序时,我在 IE 中收到错误
网页错误详细信息: 用户代理:Mozilla/4.0(兼容;MSIE 8.0;Windows NT 6.0;WOW64;Trident/4.0;SLCC1;.NET CLR 2.0.50727;InfoPath.2;.NET CLR 3.5.30729;MS-RTC LM 8;.NET CLR 3.0.30729;OfficeLiveConnector.1.4; 时间戳:2009 年 8 月 7 日星期五 13:12:30 UTC
消息:ASP.NET Ajax 客户端框架加载失败。 线路:38 字符:34 代码:0 URI:htt://localhost:4063/Silverlight.aspx消息:“Sys”未定义 线路:48 字符:1 代码:0 URI:htt://localhost:4063/Silverlight.aspx
消息:“Sys”未定义 线路:57 字符:1 代码:0 URI:htt://localhost:4063/Silverlight.aspx
消息:“Sys”未定义 线路:67 字符:1 代码:0 URI:htt://localhost:4063/Silverlight.aspx
在 Firefox 中:
ASP.NET Ajax 客户端框架加载失败。 [中断此错误] if (typeof(Sys) === 'undefined') throw n...ient-side 框架加载失败。');\r\n
所以我不确定问题是什么。 虽然上面写着 AJAX
,但我不确定下一步是什么
(上面的 htt 是 http,但该网站不允许我在帖子中添加多个超链接,所以我改成htt) 希望有人愿意帮忙。 香农
I've written a small silverlight
app in vs 2008. Now I'd like to plug that app into a site that was developed using vs.net 2005. what are the steps needed to do this. This is what I've done so far.
In web.config
<compilation debug="true" strict="false" explicit="true">
<assemblies>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.SilverlightControls" assembly="System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
In the asp page.
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI.SilverlightControls" Assembly="System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<body>
<form id="form1" runat="server">
<div>
Silverlight Test
<asp:ScriptManager ID="scriptManager" runat="server" />
<div style="height: 100%;">
<asp:Silverlight ID="silverlightControl" runat="server" Source="~/TypingTestV2.xap"
MinimumVersion="2.0.31005.0" Width="100%" Height="100%" />
</div>
</div>
</form>
When i run the app, i get an error in IE
Webpage error details :
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.5.30729; MS-RTC LM 8; .NET CLR 3.0.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
Timestamp: Fri, 7 Aug 2009 13:12:30 UTC
Message: ASP.NET Ajax client-side framework failed to load.
Line: 38
Char: 34
Code: 0
URI: htt://localhost:4063/Silverlight.aspxMessage: 'Sys' is undefined
Line: 48
Char: 1
Code: 0
URI: htt://localhost:4063/Silverlight.aspxMessage: 'Sys' is undefined
Line: 57
Char: 1
Code: 0
URI: htt://localhost:4063/Silverlight.aspxMessage: 'Sys' is undefined
Line: 67
Char: 1
Code: 0
URI: htt://localhost:4063/Silverlight.aspx
and in Firefox :
ASP.NET Ajax client-side framework failed to load.
[Break on this error] if (typeof(Sys) === 'undefined') throw n...ient-side framework failed to load.');\r\n
So i'm not sure what the problem is. although it says AJAX
, I'm not sure what the next step would be
(the htt above was http, but the site won't allow me to do more than one hyperlink in the post, so i changed it to htt)
hope someone is willing to help.
Shannon
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Sliverlight 3 已经删除了 asp silverlight 服务器控件,因此您最好复制 VS 2008 创建的测试 .htm 页面的内容。 直接在 ASP.NET 2.0 应用程序中使用
Sliverlight 3 has dropped the asp silverlight server control, hence you would be better off duplicating the content of the test .htm page that VS 2008 creates. Use the
<object>
tag directly in your ASP.NET 2.0 app.