简体   繁体   English

含Silverlight(C#)和旧式ASP.NET(VB.NET)代码的母版页

[英]Masterpage with Silverlight (C#) and Legacy ASP.NET (VB.NET) code

I'm working to include Silverlight functionality in a legacy web application based in VB.NET. 我正在努力在基于VB.NET的旧版Web应用程序中包含Silverlight功能。 With the change we are also switching from VB to C# (all new development is C#, so I need a C# answer). 通过更改,我们也从VB切换到C#(所有新开发的都是C#,因此我需要一个C#答案)。 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控件或旧版模块/页面。

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? 有没有一种方法可以根据用户从菜单中选择的内容,将“内容区域”切换到VB ASP.NET页面或C#Silverlight组件? FYI- the menu and navigation are provided by Silverlight controls as well. 仅供参考-Silverlight控件也提供菜单和导航。

Thanks! 谢谢!

It's not a case of "Silverlight or ASP.NET". 不是“ Silverlight或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. 从您的应用程序角度来看,交付Silverlight组件与交付图像没有什么不同-对象是客户端标记的一部分。 Your ASP.NET code will determine what needs to be displayed in the codebehind and push the necessary out to the browser. 您的ASP.NET代码将确定需要在背后的代码中显示什么,并将必要的内容推送到浏览器。

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/zh-cn/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://jesseliberty.com/2008/12/26/passing-parameters-into-silverlight-applications/

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

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? 我是不是在误解您的问题?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM