Beginner Question Asp.Net

Discussion in 'ASP .Net Web Controls' started by Roger Stenson, Apr 9, 2008.

  1. Hi all
    I would be grateful for some advice on setting the "body" properties of a
    MasterForm programatically in "VB"
    Roger Stenson
     
    Roger Stenson, Apr 9, 2008
    #1
    1. Advertising

  2. Thanks for your help. Really appreciate it.
    I had arrived at the method but the appropriate syntax -
    "Attributes.Add("style," etc did not emerge from my fidling with the
    autosuggestions by the compiler. Your proposal worked a treat enabling me to
    complete the set up of the user options relating to page format
    Roger Stenson

    "David R. Longnecker" <> wrote in message
    news:...
    > Roger-
    >
    > You can by control the body properties by turning it into a
    > HtmlGenericControl.
    >
    > 1. Add the runat="server" and an id attribute to your body tag.
    > <body runat="server" id="MasterBodyTag">
    >
    > 2. In your code behind, you can address the body tag with whatever Id you
    > assign to it.
    > Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles Me.Load
    > MasterBodyTag.Attributes.Add("style", "color:#ff9900")
    > MasterBodyTag.Controls.Add(New LiteralControl("<p>Hello,
    > world!</p>"))
    > End Sub
    >
    > 3. View your page, if you look at the source code, you should see:
    >
    > <body id="ctl00_MasterBodyTag" style="bgcolor:#ff9900">
    >
    > and
    >
    > <p>Hello, world!</p>
    >
    > inside the body tag.
    >
    > Hope this helps!
    >
    > -dl
    >
    > --
    > David R. Longnecker
    > http://blog.tiredstudent.com
    >
    >> Hi all
    >> I would be grateful for some advice on setting the "body" properties
    >> of a
    >> MasterForm programatically in "VB"
    >> Roger Stenson

    >
    >
     
    Roger Stenson, Apr 9, 2008
    #2
    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. suzy

    beginner asp.net question

    suzy, May 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    389
    Andy Gaskell
    May 15, 2004
  2. Phil Winstanley [Microsoft MVP ASP.NET]

    Re: beginner asp.net question

    Phil Winstanley [Microsoft MVP ASP.NET], May 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    448
  3. =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=

    No Class at ALL!!! beginner/beginner question

    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, Feb 2, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    621
    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=
    Feb 3, 2005
  4. Rensjuh
    Replies:
    7
    Views:
    1,008
    Mabden
    Sep 2, 2004
  5. william nelson

    Beginner's Beginner

    william nelson, Apr 11, 2011, in forum: Ruby
    Replies:
    7
    Views:
    234
    7stud --
    Apr 12, 2011
Loading...

Share This Page