Is it possible to host a silverlight application on a classic asp page? I see examples where the silverlight application is hosted on a html page, and I do understand that Silverlight is a client side language, but since I need to pass data from the page to the silverlight application, I am not too sure what to do.
是否可以在经典的asp页面上托管silverlight应用程序?我看到了Silverlight应用程序托管在html页面上的示例,我确实理解Silverlight是一种客户端语言,但由于我需要将数据从页面传递到silverlight应用程序,所以我不太清楚该怎么做。
PS: the silverlight application is also database driven, so it will be connected to the database, and I have searched Google and nothing found, only be able to find Silverlight with ASP.net.
PS:silverlight应用程序也是数据库驱动的,所以它将连接到数据库,我搜索谷歌并没有找到任何结果,只能用ASP.net找到Silverlight。
Can anyone help me?
谁能帮我?
Thanks
4 个解决方案
#1
4
You can host Silverlight in HTML.
您可以在HTML中托管Silverlight。
MSDN - Hosting Silverlight in the browser
MSDN - 在浏览器中托管Silverlight
#2
1
Silverlight can exist on any HTML page (classic ASP or other). It uses an tag to host so as long as you're outputting HTML, you're fine.
Silverlight可以存在于任何HTML页面上(经典ASP或其他)。它使用标签来托管,所以只要你输出HTML,你就没事了。
#3
0
You can probably do what you want via the initParams parameter, at least as far as sending data from the page to the Silverlight app at load time. If you're setting it from the server, you can just do something like: (forgive syntax errors, I don't know classic ASP)
您可以通过initParams参数执行所需操作,至少在加载时将数据从页面发送到Silverlight应用程序。如果您从服务器设置它,您可以执行以下操作:(原谅语法错误,我不知道经典ASP)
<object type="application/x-silverlight-2" data="data:application/x-silverlight," ... >
<param name="initParams" value="<% Response.Write("foo=bar,bin=baz") %>" />
</object>
Connecting to the database should be exposed via a webservice. You probably don't want your users connecting directly to your database anyways. It doesn't really matter what your service is implemented in, you should still be able to consume it in your Silverlight application.
应通过Web服务公开连接到数据库。您可能不希望用户直接连接到您的数据库。实现您的服务并不重要,您仍然可以在Silverlight应用程序中使用它。
#4
0
As others have pointed out hosting the Silverlight control itself in an ASP pages is a doddle. However I suspect your main issue is where you say "the silverlight application is also database driven, so it will be connected to the database". Now that is much trickier if you can only use classic ASP on the server.
正如其他人指出,在ASP页面中托管Silverlight控件本身是一件轻而易举的事。但是我怀疑你的主要问题是你说“Silverlight应用程序也是数据库驱动的,所以它将连接到数据库”。如果你只能在服务器上使用经典ASP,那就更难了。
Initially I would say why not create an ASP.NET application to host some WCF or ADO.NET Data Service to supply the SL app with its data.
最初我会说为什么不创建一个ASP.NET应用程序来托管一些WCF或ADO.NET数据服务来为SL应用程序提供其数据。
Failing that if your back end must strictly be ASP classic only then you aren't going to find examples of ASP to Silverlight. However you should be able to find examples of creating SOAP based web services and WSDL stuff in classic ASP. You should also be able to find examples of creating Silverlight apps that consume SOAP/WSDL backed services. You can then stich these two skills together.
如果你的后端必须严格地只是ASP经典,那么你就不会在Silverlight中找到ASP的例子。但是,您应该能够在经典ASP中找到创建基于SOAP的Web服务和WSDL内容的示例。您还应该能够找到创建使用SOAP / WSDL支持服务的Silverlight应用程序的示例。然后你可以将这两种技能结合在一起。
I must stress though you would be better off using and ASP.NET backed for the data access. This does not require that you upgrade all your existing ASP code right now to ASP.NET, you just create a sub-application in ASP.NET to bind to the SL app.
我必须强调,尽管你最好还是使用ASP.NET支持数据访问。这不需要您现在将所有现有ASP代码升级到ASP.NET,只需在ASP.NET中创建一个子应用程序即可绑定到SL应用程序。
#1
4
You can host Silverlight in HTML.
您可以在HTML中托管Silverlight。
MSDN - Hosting Silverlight in the browser
MSDN - 在浏览器中托管Silverlight
#2
1
Silverlight can exist on any HTML page (classic ASP or other). It uses an tag to host so as long as you're outputting HTML, you're fine.
Silverlight可以存在于任何HTML页面上(经典ASP或其他)。它使用标签来托管,所以只要你输出HTML,你就没事了。
#3
0
You can probably do what you want via the initParams parameter, at least as far as sending data from the page to the Silverlight app at load time. If you're setting it from the server, you can just do something like: (forgive syntax errors, I don't know classic ASP)
您可以通过initParams参数执行所需操作,至少在加载时将数据从页面发送到Silverlight应用程序。如果您从服务器设置它,您可以执行以下操作:(原谅语法错误,我不知道经典ASP)
<object type="application/x-silverlight-2" data="data:application/x-silverlight," ... >
<param name="initParams" value="<% Response.Write("foo=bar,bin=baz") %>" />
</object>
Connecting to the database should be exposed via a webservice. You probably don't want your users connecting directly to your database anyways. It doesn't really matter what your service is implemented in, you should still be able to consume it in your Silverlight application.
应通过Web服务公开连接到数据库。您可能不希望用户直接连接到您的数据库。实现您的服务并不重要,您仍然可以在Silverlight应用程序中使用它。
#4
0
As others have pointed out hosting the Silverlight control itself in an ASP pages is a doddle. However I suspect your main issue is where you say "the silverlight application is also database driven, so it will be connected to the database". Now that is much trickier if you can only use classic ASP on the server.
正如其他人指出,在ASP页面中托管Silverlight控件本身是一件轻而易举的事。但是我怀疑你的主要问题是你说“Silverlight应用程序也是数据库驱动的,所以它将连接到数据库”。如果你只能在服务器上使用经典ASP,那就更难了。
Initially I would say why not create an ASP.NET application to host some WCF or ADO.NET Data Service to supply the SL app with its data.
最初我会说为什么不创建一个ASP.NET应用程序来托管一些WCF或ADO.NET数据服务来为SL应用程序提供其数据。
Failing that if your back end must strictly be ASP classic only then you aren't going to find examples of ASP to Silverlight. However you should be able to find examples of creating SOAP based web services and WSDL stuff in classic ASP. You should also be able to find examples of creating Silverlight apps that consume SOAP/WSDL backed services. You can then stich these two skills together.
如果你的后端必须严格地只是ASP经典,那么你就不会在Silverlight中找到ASP的例子。但是,您应该能够在经典ASP中找到创建基于SOAP的Web服务和WSDL内容的示例。您还应该能够找到创建使用SOAP / WSDL支持服务的Silverlight应用程序的示例。然后你可以将这两种技能结合在一起。
I must stress though you would be better off using and ASP.NET backed for the data access. This does not require that you upgrade all your existing ASP code right now to ASP.NET, you just create a sub-application in ASP.NET to bind to the SL app.
我必须强调,尽管你最好还是使用ASP.NET支持数据访问。这不需要您现在将所有现有ASP代码升级到ASP.NET,只需在ASP.NET中创建一个子应用程序即可绑定到SL应用程序。