Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Multiple Silverlight 2.0 controls on same ASP .NET page
3 replies. Latest Post by Yi-Lun Luo - MSFT on May 9, 2008.
(0)
Siddhart...
Member
2 points
2 Posts
05-07-2008 9:36 AM |
Hi all,
I just migrated one of my old silverlight 1.1 app to 2.0 level. Application has two silverlight controls on same ASP .Net page.
But after the migration one of the controls has stopped displaying on the page. Although both of them loads successfully and all breakpoints were reached still the second one never shows up on the screen. The one which loads first is always displayed and other one works in the background.
I swamped both controls but still the first one (which loads first) shows up and other one executes in the background. Calling code is given below: -
<div id="divID" class="silverlightHost" style="position:absolute;" > <asp:Silverlight ID="ctlMaster" runat="server" Source="~/ClientBin/XYZ.xap" Version="2.0" Width="100%" Height="100%" EnableHtmlAccess="true" Windowless="true" OnPluginLoaded="onMasterLoad" BackColor="#00000000" OnPluginError="onError" /> </div>
<div id="divID2" class="silverlightHost"> <asp:Silverlight ID="ctlScheduler" runat="server" Source="~/ClientBin/ABC.xap" BackColor="#00000000" Version="2.0" Width="100%" Height="100%" EnableHtmlAccess="true" Windowless="false" OnPluginLoaded="onLoad" OnPluginError="onError" /> </div>
In the above scenerio, ctlMaster is displayed. If i swap ctlMaster and ctlScheduler's position then ctlScheduler is displayed.
Please helpppppp,
Sid
mchlSync
Star
14606 points
2,730 Posts
05-07-2008 9:47 AM |
Can you show me the CSS code for silverlightHost?
I think you should use some fixed width and height (not just 100% for all DIV)
05-07-2008 1:13 PM |
Thanks.. Problem was related to height and width of silverlight control. By assigning fixed height and width, control was once again visible.
But can someone explain the science behind this, as with same settings (i.e. height and width set to 100%), i was able to view silverlight controls in 1.1 version.
Thanks,
Yi-Lun L...
All-Star
25052 points
2,747 Posts
05-09-2008 1:04 AM |
Hello, I think your first Silverlight Control is too large. By specifying 100%, it'll stretch the whole browser, and thus the second one won't display... Try to use 50% instead.