RegisterClientScriptBlock in PreRender

Discussion in 'ASP .Net Web Controls' started by Jon Paugh, Nov 19, 2003.

  1. Jon Paugh

    Jon Paugh Guest

    I noticed that if in my WebControl derived class I call
    RegisterClientScriptBlock in my Render method I don't see
    the javascript, but if I call it from PreRender, I do see
    the javascript in my html page. I would love to know
    why ? :)
    Jon Paugh, Nov 19, 2003
    #1
    1. Advertising

  2. Jon Paugh

    Teemu Keiski Guest

    Because those scripts are rendered when Page passes to Render phase, so
    calling RegisterXXX methods in Render is too late for them gettting to
    outputted (because Page has already prepared them)

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist


    "Jon Paugh" <> wrote in message
    news:035e01c3aee9$bc350470$...
    > I noticed that if in my WebControl derived class I call
    > RegisterClientScriptBlock in my Render method I don't see
    > the javascript, but if I call it from PreRender, I do see
    > the javascript in my html page. I would love to know
    > why ? :)
    Teemu Keiski, Nov 20, 2003
    #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. Brian W
    Replies:
    1
    Views:
    2,906
    Yan-Hong Huang[MSFT]
    Jul 4, 2003
  2. Wes Weems
    Replies:
    1
    Views:
    406
    Ken Cox [Microsoft MVP]
    Jul 19, 2003
  3. John Livermore
    Replies:
    1
    Views:
    523
    Teemu Keiski
    Jul 25, 2003
  4. Scott
    Replies:
    0
    Views:
    395
    Scott
    Jul 27, 2003
  5. MS News
    Replies:
    10
    Views:
    3,093
    MS News \(MS LVP\)
    Aug 6, 2003
Loading...

Share This Page