Skip to main content

Microsoft Silverlight

Answered Question Multiple Silverlight 2.0 controls on same ASP .NET pageRSS Feed

(0)

Siddharth.parashar
Siddhart...

Member

Member

2 points

2 Posts

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
 

 


 

mchlSync
mchlSync

Star

Star

14606 points

2,730 Posts

Silverlight MVP

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!)

Regards,
Michael Sync
Silverlight MVP

Blog : http://michaelsync.net


Siddharth.parashar
Siddhart...

Member

Member

2 points

2 Posts

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 

Yi-Lun Luo - MSFT
Yi-Lun L...

All-Star

All-Star

25052 points

2,747 Posts

Answered Question

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.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities