This is a migrated thread and some comments may be shown as answers.

Adapting silverlight content to web page width/height

1 Answer 43 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 11 Aug 2009, 07:27 AM
Hello to everybody,
I'm facing difficulties adapting the silverlight control to the height/width of the page, if I don't set the height of the div I've got a wrong behavior on FFOX, I need to set something as :

 
   <div style="height: 780px;"
        <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/application.xap" MinimumVersion="2.0.31005.0" 
            Width="100%" Height="100%"
        </asp:Silverlight> 
    </div> 

How can I set the silverlight content to adapt to the screen resolution ? (for example one client can have a 640x480 res, I know it's 2009 but you never know)

Thanks in advance

Paolo


1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 11 Aug 2009, 07:32 AM
Hello Paolo,

If you want FF, Chrome and other similar browsers to behave correctly you need to set height in percentage for all parent elements including HTML tag:

<style type="text/css">
html, body, form {width:100%; height:100%; margin:0; padding:0;overflow:hidden;}
</style>

...
<div style="height: 100%;">
        <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/application.xap" MinimumVersion="2.0.31005.0"
            Width="100%" Height="100%">
        </asp:Silverlight>
    </div>
...

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Michele
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Share this question
or