Page view counter
Multiple Silverlight 2.0 controls on same ASP .NET page
Last post 05-09-2008 1:04 AM by Yi-Lun Luo - MSFT. 3 replies.
Sort Posts:
05-07-2008 9:36 AM
Multiple Silverlight 2.0 controls on same ASP .NET page

 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
 

 


 

Siddharth.parashar

Loading...
Joined on 02-08-2008
Posts 2
05-07-2008 9:47 AM
Re: Multiple Silverlight 2.0 controls on same ASP .NET page

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)

(If this has answered your question, please click on "Mark as Answer" on this post. Thank you!)

Best Regards,
Michael Sync

Blog : http://michaelsync.net
Feed : http://michaelsync.net/feed

mchlSync

Loading...
Joined on 09-16-2005
Singapore
Posts 2,335
05-07-2008 1:13 PM
Re: Multiple Silverlight 2.0 controls on same ASP .NET page

 
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,

Sid 

Siddharth.parashar

Loading...
Joined on 02-08-2008
Posts 2
05-09-2008 1:04 AM
Marked as Answer
Re: Re: Multiple Silverlight 2.0 controls on same ASP .NET page

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.

shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.

Yi-Lun Luo - MSFT

Loading...
Joined on 10-29-2007
Posts 2,688
Microsoft Communities