JavaScript and Components on Pages

Discussion in 'ASP .Net' started by Alex Maghen, Feb 12, 2008.

  1. Alex Maghen

    Alex Maghen Guest

    Is there an Event in a page's life-cycle where I would be able to reference
    all of the objects that were instantiated on a page, but as soon as possible
    after the page loads? If I try to use OnLoad for the Document, objects like
    ActiveX controls don't seem to "exist" yet on the page.

    Ideas? Thanks.

    Alex
     
    Alex Maghen, Feb 12, 2008
    #1
    1. Advertising

  2. "Alex Maghen" <> wrote in message
    news:D...
    > Is there an Event in a page's life-cycle where I would be able to

    reference
    > all of the objects that were instantiated on a page, but as soon as

    possible
    > after the page loads? If I try to use OnLoad for the Document, objects

    like
    > ActiveX controls don't seem to "exist" yet on the page.
    >


    Which OnLoad event are you talking about exactly? Can you show use some
    code? The elements holding the ActiveX controls will exist at the time the
    client side window.onload event fires. Whether the contents of the elements
    have been initialised and ready for use at the point is another matter.


    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Feb 12, 2008
    #2
    1. Advertising

  3. Hello Alex,

    I would use the AJAX Sys.Application.add_load event for this

    ---
    WBR,
    Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo


    AM> Is there an Event in a page's life-cycle where I would be able to
    AM> reference all of the objects that were instantiated on a page, but
    AM> as soon as possible after the page loads? If I try to use OnLoad for
    AM> the Document, objects like ActiveX controls don't seem to "exist"
    AM> yet on the page.
    AM>
    AM> Ideas? Thanks.
    AM>
    AM> Alex
    AM>
     
    Michael Nemtsev [MVP], Feb 12, 2008
    #3
  4. Alex Maghen

    bruce barker Guest

    there iisn't an event for this. active/x control are loaded async. the onload
    event means the html has been parsed, and the dom created, but images, and
    active/x controls may not be ready yet (or even downloaded).

    all IE hosted objects have a readyState property and an onreadystatechange
    event. you can use to talk to the active/x control after its loaded and
    initialized:

    <object onreadystatechange="onReady(this)" ... />

    function onReady(e)
    {
    if (e.readyState == 4)
    {
    // control is live
    // do something here
    }
    }


    -- bruce (sqlwork.com)


    "Alex Maghen" wrote:

    > Is there an Event in a page's life-cycle where I would be able to reference
    > all of the objects that were instantiated on a page, but as soon as possible
    > after the page loads? If I try to use OnLoad for the Document, objects like
    > ActiveX controls don't seem to "exist" yet on the page.
    >
    > Ideas? Thanks.
    >
    > Alex
     
    bruce barker, Feb 12, 2008
    #4
  5. Hi Alex,

    As other members have said, Activex control are hosted by client side
    webbrowser, server side ASP.NET doesn't have much control on it. However,
    if you only want to manipulate some setting or attributes in its html
    markup, you can considering use page's "PreRender" event. This event is the
    last event you can modify control states of controls on Page(will be
    persisted into Viewstate) before Render stage.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
    >From: =?Utf-8?B?QWxleCBNYWdoZW4=?= <>
    >Subject: JavaScript and Components on Pages
    >Date: Mon, 11 Feb 2008 23:41:01 -0800


    >
    >Is there an Event in a page's life-cycle where I would be able to

    reference
    >all of the objects that were instantiated on a page, but as soon as

    possible
    >after the page loads? If I try to use OnLoad for the Document, objects

    like
    >ActiveX controls don't seem to "exist" yet on the page.
    >
    >Ideas? Thanks.
    >
    >Alex
    >
     
    Steven Cheng[MSFT], Feb 13, 2008
    #5
  6. Alex Maghen

    Steven Cheng Guest

    Hi Alex,

    Do you have any further question on this thread? If so, welcome to post
    here.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------
    >From: (Steven Cheng[MSFT])
    >Organization: Microsoft
    >Date: Wed, 13 Feb 2008 02:46:37 GMT
    >Subject: RE: JavaScript and Components on Pages


    >
    >Hi Alex,
    >
    >As other members have said, Activex control are hosted by client side
    >webbrowser, server side ASP.NET doesn't have much control on it. However,
    >if you only want to manipulate some setting or attributes in its html
    >markup, you can considering use page's "PreRender" event. This event is

    the
    >last event you can modify control states of controls on Page(will be
    >persisted into Viewstate) before Render stage.
    >
    >Sincerely,
    >
    >Steven Cheng
    >
    >Microsoft MSDN Online Support Lead
    >
    >
    >This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >--------------------
    >>From: =?Utf-8?B?QWxleCBNYWdoZW4=?= <>
    >>Subject: JavaScript and Components on Pages
    >>Date: Mon, 11 Feb 2008 23:41:01 -0800

    >
    >>
    >>Is there an Event in a page's life-cycle where I would be able to

    >reference
    >>all of the objects that were instantiated on a page, but as soon as

    >possible
    >>after the page loads? If I try to use OnLoad for the Document, objects

    >like
    >>ActiveX controls don't seem to "exist" yet on the page.
    >>
    >>Ideas? Thanks.
    >>
    >>Alex
    >>

    >
    >
     
    Steven Cheng, Feb 16, 2008
    #6
    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. Dickie Black
    Replies:
    0
    Views:
    1,213
    Dickie Black
    Aug 6, 2003
  2. Alex
    Replies:
    3
    Views:
    1,499
    Alvin Bruney
    Dec 2, 2003
  3. CJ
    Replies:
    3
    Views:
    619
    John Timney \( MVP \)
    Dec 9, 2005
  4. Mickey Segal
    Replies:
    0
    Views:
    903
    Mickey Segal
    Feb 2, 2004
  5. mf_sina

    Placing webwiz ASP-made site components in ASP pages

    mf_sina, Feb 13, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    225
    mf_sina
    Feb 13, 2005
Loading...

Share This Page