Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit How to make resizable silverlight page within an asp page?
6 replies. Latest Post by PregnantBySilverlight on September 26, 2008.
(0)
Pregnant...
Member
88 points
107 Posts
09-26-2008 1:38 PM |
Hi Everybody,
I have a silverlight page within an asp page. It looks like I have to give a specific pixel when I place my silverlight into my asp page. I want to make it flexible and resizable, therefore, if the user resize the browser, the silverlight part gets resized by the browser!
Any thoughts are welcome :)
Thanks in advance....
the problem is in the line.....<div style="height:800px;width:1200px;">
Here is my code:
<
</
sladapter
All-Star
17445 points
3,173 Posts
09-26-2008 2:44 PM |
Use Percentage instead of fixed width/height in your Silverlight Container div:
<div style="height:800px;width:1200px;">
In your Silverlight control, make sure use Grid as LayoutRoot. Do not set the Width/Height in the Grid nor in the UserControl tag.
09-26-2008 4:02 PM |
Thanks Sladapter,
Interesting, I was just going to email you directly before getting you reply to my answer
I've done the suggestion you made, and it's still doesn't work....
Here is my code Silverlight page:
Width
.................. >
....................
</Grid>
and this is a master page which I load the ContentPresenter into it.....
So this masterpage with it's ContentPresenter is within my aspx page that I posted priviously.....
Thanks in advanceMT
09-26-2008 4:15 PM |
Make sure you set the height of the TD cell(use percentage too) that contains your Silverlight control in your aspx page. Your Silverlight code looks OK. If your Content is larger than the given area, put a ScrollViewer around it.
09-26-2008 4:30 PM |
Interesting...I managed my code by using Default.aspx instead of System7TestPage.aspx....
Here is my code in Default.aspx
but it shows error for <asp:table> tag ???? not sure why???? it works fine....
however, I don't know how to make the default.aspx page as my default page....whenever I run the application....the System7TestPage.aspx is my default page!!!!!
I'm so confused, not knowing what's the difference between these three pages.... System7TestPage.html and System7TestPage.aspx and default.aspx
all these three pages are being generated at the time of creating my project called System7.What's a usage of each of them?I understand that I can make my frist page just an html page with Silverlight plug in....but then why do I have both default.aspx and System7TestPage.aspx.....
any answer would be welcome :)
Thank you so much for spending your time to answer my questions....MT
09-26-2008 4:33 PM |
Right click Default.aspx select "Set As Start Page". You only need one page. You can delete System7TestPage.aspx.
09-26-2008 4:47 PM |
Perfect...thanks a lot
now, I have another problem...this time is really strange...the errors that I'm getting....I completely delete whatever tag that I added and still I get the same errors....
here is the link to my question http://silverlight.net/forums/t/30728.aspx
thanksMT