Using initParams in Silverlight 4 project
Posted
by Silverlight Beginner
on Stack Overflow
See other posts from Stack Overflow
or by Silverlight Beginner
Published on 2010-04-26T12:10:48Z
Indexed on
2010/04/26
12:13 UTC
Read the original article
Hit count: 888
silverlight-4.0
|visual-studio-2010
I'm trying to upgrade a project that uses Silverlight 2 to use Silverlight 4 but I have problem with initparam to set domain.
The old Silverlight 2 project:
<form id="form1" runat="server" style="height:100%;">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div style="height:100%;">
<asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/EKAKC.xap" MinimumVersion="2.0.31005.0" Width="100%" Height="100%" />
</div>
</form>
And from Default.aspx.cs: Xaml1.InitParameters += "Domain=" + domain;
The new Silverlight 4 project:
<body style="height: 100%; margin: 0;">
<form id="form1" runat="server" style="height: 100%;">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div id="silverlightControlHost">
<object type="application/x-silverlight-2" data="data:application/x-silverlight,"
width="300" height="300">
<param name="source" value="EKAKC.xap"/>
<param name="initParams" value="<%= string.Format("WCFReferenceURL={0}", ConfigurationManager.AppSettings["WCFReferenceURL"])%>" />
</object>
</div>
The Domain will not be set in my new Silverlight 4 project
© Stack Overflow or respective owner