Can I get RegisterClientScriptBlock to Appear at the end?

Discussion in 'ASP .Net' started by Paul D. Fox, Sep 27, 2005.

  1. Paul D. Fox

    Paul D. Fox Guest

    I'd like to modularize my code and I like using the
    "RegisterClientScriptBlock()" routine. However, I need to have a piece of
    JavaScript registered at the end of the HTML form. My only work-around is
    to hard code it in the HTML. Can I get the RegisterClientScriptBlock() to
    write the script out at the end?

    Paul
     
    Paul D. Fox, Sep 27, 2005
    #1
    1. Advertising

  2. Have you tried RegisterStartUpScript instead? It places the JavaScript just
    before the </form> tag.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    ***************************
    Think Outside the Box!
    ***************************


    "Paul D. Fox" wrote:

    > I'd like to modularize my code and I like using the
    > "RegisterClientScriptBlock()" routine. However, I need to have a piece of
    > JavaScript registered at the end of the HTML form. My only work-around is
    > to hard code it in the HTML. Can I get the RegisterClientScriptBlock() to
    > write the script out at the end?
    >
    > Paul
    >
    >
    >
     
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, Sep 27, 2005
    #2
    1. Advertising

  3. Paul D. Fox

    Rob Schieber Guest

    Paul D. Fox wrote:
    > I'd like to modularize my code and I like using the
    > "RegisterClientScriptBlock()" routine. However, I need to have a piece of
    > JavaScript registered at the end of the HTML form. My only work-around is
    > to hard code it in the HTML. Can I get the RegisterClientScriptBlock() to
    > write the script out at the end?
    >
    > Paul
    >
    >


    Hi Paul,

    I don't think there is a specific way to do that within ASP.Net, i think
    your easiest options are to Response.Write your script block at the end
    of page execution, or to place it in the HTML like you said. If you
    want to keep it modular, you could always create a class that inherits
    from Page and create a method such as RegisterEndScriptBlock() in that
    class which outputs your script contents.

    --
    Rob Schieber
     
    Rob Schieber, Sep 27, 2005
    #3
  4. Paul D. Fox

    Paul D. Fox Guest

    Ah yes, technically your correct and I've already tried it before this post.
    However, I now found its an issue with Plumtree Corporate Portal Software
    and not .NET. Oh well, we tried...

    Paul

    "Cowboy (Gregory A. Beamer) - MVP" <> wrote
    in message news:...
    > Have you tried RegisterStartUpScript instead? It places the JavaScript
    > just
    > before the </form> tag.
    >
    > --
    > Gregory A. Beamer
    > MVP; MCP: +I, SE, SD, DBA
    >
    > ***************************
    > Think Outside the Box!
    > ***************************
    >
    >
    > "Paul D. Fox" wrote:
    >
    >> I'd like to modularize my code and I like using the
    >> "RegisterClientScriptBlock()" routine. However, I need to have a piece
    >> of
    >> JavaScript registered at the end of the HTML form. My only work-around
    >> is
    >> to hard code it in the HTML. Can I get the RegisterClientScriptBlock()
    >> to
    >> write the script out at the end?
    >>
    >> Paul
    >>
    >>
    >>
     
    Paul D. Fox, Sep 27, 2005
    #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. Tariq Ahmad
    Replies:
    3
    Views:
    427
    Kevin Spencer
    Jul 12, 2003
  2. Mike Wilmot
    Replies:
    0
    Views:
    3,304
    Mike Wilmot
    Dec 15, 2003
  3. Carlos Oliveira
    Replies:
    0
    Views:
    19,010
    Carlos Oliveira
    Aug 19, 2004
  4. Replies:
    0
    Views:
    430
  5. Stan SR
    Replies:
    3
    Views:
    733
    Laurent Bugnion, GalaSoft
    Oct 6, 2006
Loading...

Share This Page