Silverlight: setting the background of the entire page

Discussion in 'ASP .Net' started by VRSki@newsgroup.nospam, Jan 27, 2009.

  1. Guest

    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
    , Jan 27, 2009
    #1
    1. Advertising

  2. 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
    Göran Andersson, Jan 27, 2009
    #2
    1. Advertising

  3. Guest

    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:

    > 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
    >
    , Jan 29, 2009
    #3
  4. Guest

    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.
    "" 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:
    >
    > > 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
    > >
    , Jan 29, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Water Cooler v2
    Replies:
    3
    Views:
    36,913
    Water Cooler v2
    Jul 12, 2006
  2. Maarten
    Replies:
    1
    Views:
    4,253
    Ben C
    Feb 4, 2008
  3. Adam The Generic

    setting entire row as a hyperlink

    Adam The Generic, Apr 4, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    333
    imransyed63
    Apr 5, 2009
  4. Replies:
    2
    Views:
    179
  5. Water Cooler v2
    Replies:
    1
    Views:
    167
    David Dorward
    Jul 12, 2006
Loading...

Share This Page