Body Onload

Discussion in 'ASP .Net' started by Arne Garvander, Sep 25, 2008.

  1. I have an asp.net page with a master page.
    How do I dynamically create an HTML body onload event?
    <body onload="CalcTotal()";

    --
    Arne Garvander
    (I program VB.Net for fun and C# to get paid.)
     
    Arne Garvander, Sep 25, 2008
    #1
    1. Advertisements

  2. If you give the body tag an id and runat="server" you can do it from either
    the Master Page's Load or Init event or the Content Page's PreInit event.
    You will do this by using the body tag's Attributes property. Good Luck!
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    "Arne Garvander" <> wrote in message
    news:...
    >I have an asp.net page with a master page.
    > How do I dynamically create an HTML body onload event?
    > <body onload="CalcTotal()";
    >
    > --
    > Arne Garvander
    > (I program VB.Net for fun and C# to get paid.)
     
    Nathan Sokalski, Sep 25, 2008
    #2
    1. Advertisements

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. Fabio R.
    Replies:
    0
    Views:
    1,032
    Fabio R.
    Mar 25, 2005
  2. UJ
    Replies:
    4
    Views:
    9,883
    =?Utf-8?B?U3JlZWppdGggUmFt?=
    Jul 19, 2005
  3. cmay
    Replies:
    2
    Views:
    4,227
  4. =?Utf-8?B?Q2FsdmluIEtE?=

    <body onload="alert('Hello');"> does not work! Why?

    =?Utf-8?B?Q2FsdmluIEtE?=, Aug 25, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    11,502
    =?Utf-8?B?Q2FsdmluIEtE?=
    Aug 29, 2005
  5. baroque Chou
    Replies:
    1
    Views:
    2,119
    Laurent Bugnion
    Jan 24, 2006
  6. David Otton

    window.onload and body.onload differences

    David Otton, Nov 4, 2004, in forum: Javascript
    Replies:
    2
    Views:
    837
    Martin Honnen
    Nov 4, 2004
  7. Replies:
    5
    Views:
    504
    Thomas 'PointedEars' Lahn
    May 15, 2005
  8. marco

    onload -->* no onload

    marco, Jun 22, 2006, in forum: Javascript
    Replies:
    7
    Views:
    458
    marco
    Jun 24, 2006
Loading...