Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Silverlight: setting the background of the entire page

Reply
Thread Tools

Silverlight: setting the background of the entire page

 
 
VRSki@newsgroup.nospam
Guest
Posts: n/a
 
      01-27-2009
I created a Silverlight application, which is hosted by an ASP.NET app
(default IDE settings for creating a Silverlight app). There are 2 projects
created by default: ASP.NET (hosting the Silverlight control) and the
Silverlight project with the control's code.

I'd like to set the background of the entire page as it appears on user's
browser to a certain color. Setting the background color on the Silverlight
control itself, only paints the controls area, but the rest of the background
is still the default white.

I tried different things:
- setitng the style in every <div> I could find in the asp.net side
- setting the silverlight control:
<asp:Silverlight ID="Xaml1" runat="server" ... PlugInBackColor="..." />
and
<asp:Silverlight ID="Xaml1" runat="server" ... BackColor="..." />

What am I missing? I noticed, in the App code (Silverlight), I can get
access to Host.Background, but it's readonly.

Any help is greatly appreciated.

VR

 
Reply With Quote
 
 
 
 
Göran Andersson
Guest
Posts: n/a
 
      01-27-2009
http://www.velocityreviews.com/forums/(E-Mail Removed)am wrote:
> I created a Silverlight application, which is hosted by an ASP.NET app
> (default IDE settings for creating a Silverlight app). There are 2 projects
> created by default: ASP.NET (hosting the Silverlight control) and the
> Silverlight project with the control's code.
>
> I'd like to set the background of the entire page as it appears on user's
> browser to a certain color. Setting the background color on the Silverlight
> control itself, only paints the controls area, but the rest of the background
> is still the default white.
>
> I tried different things:
> - setitng the style in every <div> I could find in the asp.net side
> - setting the silverlight control:
> <asp:Silverlight ID="Xaml1" runat="server" ... PlugInBackColor="..." />
> and
> <asp:Silverlight ID="Xaml1" runat="server" ... BackColor="..." />
>
> What am I missing? I noticed, in the App code (Silverlight), I can get
> access to Host.Background, but it's readonly.
>
> Any help is greatly appreciated.
>
> VR
>


Set the background of the body of the document. Add this in the <head>
tag of the page:

<style type="text/css">
body { background: red; }
</style>

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
 
 
 
VRSki@newsgroup.nospam
Guest
Posts: n/a
 
      01-29-2009
Göran,

Thanks for the post. I tried that, but what I see is a brief flicker to red
upon the app's loading, and that it switches back to white. It appears as if
there is something else that hosts the control... can't figure out what it
is...

Any ideas?

Much appreciated,
VR

"Göran Andersson" wrote:

> (E-Mail Removed)am wrote:
> > I created a Silverlight application, which is hosted by an ASP.NET app
> > (default IDE settings for creating a Silverlight app). There are 2 projects
> > created by default: ASP.NET (hosting the Silverlight control) and the
> > Silverlight project with the control's code.
> >
> > I'd like to set the background of the entire page as it appears on user's
> > browser to a certain color. Setting the background color on the Silverlight
> > control itself, only paints the controls area, but the rest of the background
> > is still the default white.
> >
> > I tried different things:
> > - setitng the style in every <div> I could find in the asp.net side
> > - setting the silverlight control:
> > <asp:Silverlight ID="Xaml1" runat="server" ... PlugInBackColor="..." />
> > and
> > <asp:Silverlight ID="Xaml1" runat="server" ... BackColor="..." />
> >
> > What am I missing? I noticed, in the App code (Silverlight), I can get
> > access to Host.Background, but it's readonly.
> >
> > Any help is greatly appreciated.
> >
> > VR
> >

>
> Set the background of the body of the document. Add this in the <head>
> tag of the page:
>
> <style type="text/css">
> body { background: red; }
> </style>
>
> --
> Göran Andersson
> _____
> http://www.guffa.com
>

 
Reply With Quote
 
VRSki@newsgroup.nospam
Guest
Posts: n/a
 
      01-29-2009
Got it. In addition to setting the color, control itself (ir I guess the
window that hosts it and created automatically), needs to be trasparent...

<asp:Silverlight ... PluginBackground="Transparent">

Thanks again for all the help.
"(E-Mail Removed)" wrote:

> Göran,
>
> Thanks for the post. I tried that, but what I see is a brief flicker to red
> upon the app's loading, and that it switches back to white. It appears as if
> there is something else that hosts the control... can't figure out what it
> is...
>
> Any ideas?
>
> Much appreciated,
> VR
>
> "Göran Andersson" wrote:
>
> > (E-Mail Removed)am wrote:
> > > I created a Silverlight application, which is hosted by an ASP.NET app
> > > (default IDE settings for creating a Silverlight app). There are 2 projects
> > > created by default: ASP.NET (hosting the Silverlight control) and the
> > > Silverlight project with the control's code.
> > >
> > > I'd like to set the background of the entire page as it appears on user's
> > > browser to a certain color. Setting the background color on the Silverlight
> > > control itself, only paints the controls area, but the rest of the background
> > > is still the default white.
> > >
> > > I tried different things:
> > > - setitng the style in every <div> I could find in the asp.net side
> > > - setting the silverlight control:
> > > <asp:Silverlight ID="Xaml1" runat="server" ... PlugInBackColor="..." />
> > > and
> > > <asp:Silverlight ID="Xaml1" runat="server" ... BackColor="..." />
> > >
> > > What am I missing? I noticed, in the App code (Silverlight), I can get
> > > access to Host.Background, but it's readonly.
> > >
> > > Any help is greatly appreciated.
> > >
> > > VR
> > >

> >
> > Set the background of the body of the document. Add this in the <head>
> > tag of the page:
> >
> > <style type="text/css">
> > body { background: red; }
> > </style>
> >
> > --
> > Göran Andersson
> > _____
> > http://www.guffa.com
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Background color <div> not within entire section Maarten HTML 1 02-04-2008 08:55 PM
Stretch a <TABLE> background image to fill the entire cell Water Cooler v2 HTML 3 07-12-2006 10:48 PM
Stretch a <TABLE> background image to fill the entire cell Water Cooler v2 Javascript 1 07-12-2006 10:07 PM
refreshing control data on a page, without the entire page re-loading Milsnips ASP .Net 1 05-16-2005 10:35 AM



Advertisments