使用Silverlight(C#)和旧版ASP.NET(VB.NET)代码的主页

时间:2021-10-08 01:40:16

I'm working to include Silverlight functionality in a legacy web application based in VB.NET. With the change we are also switching from VB to C# (all new development is C#, so I need a C# answer). I'd like to use some form of master page where the content area can house either a silverlight control or a legacy module/page.

我正在努力将Silverlight功能包含在基于VB.NET的遗留Web应用程序中。随着更改,我们也从VB切换到C#(所有新开发都是C#,所以我需要一个C#答案)。我想使用某种形式的母版页,其中内容区域可以容纳silverlight控件或传统模块/页面。

The options I've seen so far will enable one or the other, but not both. Is there a way to switch out the 'content area' to either a VB ASP.NET page or a C# Silverlight component based on what the user picks from the menu? FYI- the menu and navigation are provided by Silverlight controls as well.

到目前为止我看到的选项将启用一个或另一个,但不是两个。有没有办法根据用户从菜单中选择的内容将“内容区域”切换到VB ASP.NET页面或C#Silverlight组件?仅供参考 - 菜单和导航也由Silverlight控件提供。

Thanks!

3 个解决方案

#1


This isn't so much an answer as a request for clarification.

这不是一个澄清要求的答案。

OK, so as I understand it, you would like to have a masterpage whose content template will contain EITHER some legacy asp.net stuff, OR a Silverlight control, determined by some business logic or user input.

好的,据我所知,您希望有一个母版页,其内容模板将包含一些遗留的asp.net内容,或者一个Silverlight控件,由某些业务逻辑或用户输入决定。

Why is this a problem? It seems like a perfectly natural thing to do, and to my knowledge master pages don't really care what their inner content template will hold. Seems like you could define a multiview in the contents that would change it's active view based on your needs, and one view could contain your legacy stuff, while the other could contain Silverlight.

为什么这是个问题?这似乎是一件非常自然的事情,据我所知,母版页并不关心他们的内部内容模板会持有什么。好像你可以在内容中定义一个多视图,根据你的需要改变它的活动视图,一个视图可以包含你的遗留内容,而另一个视图可以包含Silverlight。

Am I misconstruing your problem?

我误解了你的问题吗?

#2


It's not a case of "Silverlight or ASP.NET". From your apps perspective delivering the Silverlight component is no different to delivering, say, an image - the object is part of the client side markup. Your ASP.NET code will determine what needs to be displayed in the codebehind and push the necessary out to the browser.

这不是“Silverlight或ASP.NET”的情况。从您的应用程序角度来看,提供Silverlight组件与传递图像没什么不同 - 该对象是客户端标记的一部分。您的ASP.NET代码将确定需要在代码隐藏中显示的内容并将必要的内容推送到浏览器。

#3


There is also an asp.net silverlight control... Details here... http://msdn.microsoft.com/en-us/library/cc838274(VS.95).aspx

还有一个asp.net silverlight控件...详细信息在这里... http://msdn.microsoft.com/en-us/library/cc838274(VS.95).aspx

so depending on your code you could display asp.net stuff or the silverlight control which itself takes care of the silverlight stuff... you can also pass values (parameters) into the silverlight control as well as use the bridge to talk from silverlight to the html...

所以根据你的代码,你可以显示asp.net的东西或silverlight控件本身负责silverlight的东西...你也可以将值(参数)传递到silverlight控件,以及使用桥梁从silverlight交谈HTML ...

http://jesseliberty.com/2008/12/26/passing-parameters-into-silverlight-applications/

http://www.codeproject.com/KB/silverlight/SilverlightHtmlBlend.aspx

#1


This isn't so much an answer as a request for clarification.

这不是一个澄清要求的答案。

OK, so as I understand it, you would like to have a masterpage whose content template will contain EITHER some legacy asp.net stuff, OR a Silverlight control, determined by some business logic or user input.

好的,据我所知,您希望有一个母版页,其内容模板将包含一些遗留的asp.net内容,或者一个Silverlight控件,由某些业务逻辑或用户输入决定。

Why is this a problem? It seems like a perfectly natural thing to do, and to my knowledge master pages don't really care what their inner content template will hold. Seems like you could define a multiview in the contents that would change it's active view based on your needs, and one view could contain your legacy stuff, while the other could contain Silverlight.

为什么这是个问题?这似乎是一件非常自然的事情,据我所知,母版页并不关心他们的内部内容模板会持有什么。好像你可以在内容中定义一个多视图,根据你的需要改变它的活动视图,一个视图可以包含你的遗留内容,而另一个视图可以包含Silverlight。

Am I misconstruing your problem?

我误解了你的问题吗?

#2


It's not a case of "Silverlight or ASP.NET". From your apps perspective delivering the Silverlight component is no different to delivering, say, an image - the object is part of the client side markup. Your ASP.NET code will determine what needs to be displayed in the codebehind and push the necessary out to the browser.

这不是“Silverlight或ASP.NET”的情况。从您的应用程序角度来看,提供Silverlight组件与传递图像没什么不同 - 该对象是客户端标记的一部分。您的ASP.NET代码将确定需要在代码隐藏中显示的内容并将必要的内容推送到浏览器。

#3


There is also an asp.net silverlight control... Details here... http://msdn.microsoft.com/en-us/library/cc838274(VS.95).aspx

还有一个asp.net silverlight控件...详细信息在这里... http://msdn.microsoft.com/en-us/library/cc838274(VS.95).aspx

so depending on your code you could display asp.net stuff or the silverlight control which itself takes care of the silverlight stuff... you can also pass values (parameters) into the silverlight control as well as use the bridge to talk from silverlight to the html...

所以根据你的代码,你可以显示asp.net的东西或silverlight控件本身负责silverlight的东西...你也可以将值(参数)传递到silverlight控件,以及使用桥梁从silverlight交谈HTML ...

http://jesseliberty.com/2008/12/26/passing-parameters-into-silverlight-applications/

http://www.codeproject.com/KB/silverlight/SilverlightHtmlBlend.aspx