views:

52

answers:

1

I'm planning on hosting a Silverlight application in ASP.NET 2.o web application. The web app has to keep on targeting 2.0 framework for the foreseeable future. That rules out the Silverlight control as that would force me to upgrade my web app to 3.5.

Fortunately, I can take the approach of adding the control with html

My question is how can i programatically set the InitParams for the Silverlight app when I take this approach.

+3  A: 

When you say programmatically, do you mean you still want the server to set some values? Consider a LiteralControl and have it replace with the:

<param name="initparams" value="foo" />

Where you need it, so it might look something like this:

<object...>
...
<asp:Literal id="initParamsPlaceholder" runat="server" />
</object>
Tim Heuer
I really prefer the object tag, I always use that, and it works with MVC :) Anything you can do with the Silverlight control you can do with the object tag, take a look at the HTML that the Silverlight object creates to see what to add to the page and Tim has good advice here.
Bill Reiss
Ya, you object tag sorts ;) I soured on it with the whole click to activate fiasco. Now, I pretty much always use CreateObjectEx. I think it's partly the "Ex". It just has that Win32 API/COM feel that takes me back...
Erik Mork
Hey Tim, thanks for the reply. Yes I want the server to set some values. Your suggestion works a treat. Thanks.
JohnC