Oh wait, that is from ASPX... can you adjust the containing div from within Silverlight without going over JS bridge yourself?
This feels a little hack-ish:
HtmlPage.Document.GetElementById("commentsSection").SetStyleAttribute("height",
string.Format("{0}px", acutalHeight));
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jordan Knight
Sent: Monday, 1 September 2008 7:04 PM
To: [email protected]
Subject: RE: [OzSilverlight] RE: Setting SL contol top 100%
Cool, looks a bit easier than my hack going across the JS bridge :)
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stephen Price
Sent: Monday, 1 September 2008 6:33 PM
To: [email protected]
Subject: Re: [OzSilverlight] RE: Setting SL contol top 100%
the Unit("100%") works for me. If I change the plugin background to a different
colour I can see it using 100% of the browser.
What I'm puzzled about is that I can't see the silverlight page contents, its
blank.
namespace SLPluginWeb {
public partial class _Default : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) {
Silverlight silverlightControl = new Silverlight();
silverlightControl.ID = "TechEd2008";
silverlightControl.Width = new Unit("100%");
silverlightControl.Height = new Unit("100%");
silverlightControl.MinimumVersion = "2.0.30523";
silverlightControl.PluginBackground = Color.Red;
silverlightControl.Source = "~/ClientBin/SLPlugin.xap";
this.Controls.Add(silverlightControl);
}
}
}
in the on_PageLoad, it gives me a blank control. I've just got a button in the
silverlight page which loads fine from the html test page.
Can't seem to find a good example of silverlight controls being added from
asp.net<http://asp.net> code behind.
On Mon, Sep 1, 2008 at 4:25 PM, Jordan Knight <[EMAIL PROTECTED]<mailto:[EMAIL
PROTECTED]>> wrote:
Sorry that was worded badly:
The post outlines how to re-size the containing <div> to the same size as the
content (it stretches and contracts as you do stuff in the Silverlight
control).. this is cool for something like a comments control where users can
keep adding more comments and the control needs to stretch down the page).
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>] On
Behalf Of Jordan Knight
Sent: Monday, 1 September 2008 6:17 PM
To: [email protected]
Subject: [OzSilverlight] RE: Setting SL contol top 100%
Hey Phil,
I wrote a little blog post here
http://jakkaj.wordpress.com/2008/07/05/resize-silverlight-control-div/ on how
to control the size of the control from code. This code makes it the size that
is required automatically, but I'm sure you can adapt it :)
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>] On
Behalf Of Philip Beadle
Sent: Monday, 1 September 2008 4:56 PM
To: [email protected]
Subject: [OzSilverlight] Setting SL contol top 100%
Any ideas how to set the control width and height in code to 100%?
Dim silverlightControl As New
System.Web.UI.SilverlightControls.Silverlight
silverlightControl.ID = "TechEd2008"
silverlightControl.MinimumVersion = "2.0.30523"
silverlightControl.Source = "~/ClientBin/SL_TechEd.xap"
silverlightControl.Width = 700
silverlightControl.Height = 700
Dim initParams As String =
String.Format("ModuleId={0},IsEditable={1}", ModuleId.ToString,
Me.ModuleContext.IsEditable)
silverlightControl.InitParameters = initParams
phSilverlight.Controls.Add(silverlightControl)
Regards,
Philip Beadle
Readify | Principal Consultant
Microsoft MVP - ASP/ASP.NET<http://asp.net/>, MCAD, MCT
[cid:[email protected]]
Suite 206 Nolan Tower | 29 Rakaia Way | Docklands | VIC 3008 | Australia
M: +61 417 301 024 | E: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> | C: [EMAIL
PROTECTED] | W: www.readify.net<http://www.readify.net/>
________________________________
The content of this e-mail, including any attachments is a confidential
communication between Readify Pty Ltd and the intended addressee and is for the
sole use of that intended addressee. If you are not the intended addressee, any
use, interference with, disclosure or copying of this material is unauthorized
and prohibited. If you have received this e-mail in error please contact the
sender immediately and then delete the message and any attachment(s).
P Please consider your environmental responsibility before printing this e-mail
-------------------------------------------------------------------
OzSilverlight.com - to unsubscribe from this list, send a message back to the
list with 'unsubscribe' as the subject.
Powered by mailenable.com<http://mailenable.com/> - List managed by
www.readify.net<http://www.readify.net/>
-------------------------------------------------------------------
OzSilverlight.com - to unsubscribe from this list, send a message back to the
list with 'unsubscribe' as the subject.
Powered by mailenable.com<http://mailenable.com/> - List managed by
www.readify.net<http://www.readify.net/>
-------------------------------------------------------------------
OzSilverlight.com - to unsubscribe from this list, send a message back to the
list with 'unsubscribe' as the subject.
Powered by mailenable.com<http://mailenable.com/> - List managed by
www.readify.net<http://www.readify.net/>
-------------------------------------------------------------------
OzSilverlight.com - to unsubscribe from this list, send a message back to the
list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net
-------------------------------------------------------------------
OzSilverlight.com - to unsubscribe from this list, send a message back to the
list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net
-------------------------------------------------------------------
OzSilverlight.com - to unsubscribe from this list, send a message back to the
list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net
<<inline: image001.gif>>
