views:

859

answers:

3

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.

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.

Thanks!

A: 

There is also an asp.net silverlight control... Details here... 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...

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

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

silverfighter
A: 

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.

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.

Am I misconstruing your problem?

A: 

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.

Doobi