Professional Web Applications Themes

output javascript to appear at end of page? - ASP.NET General

hi, i want to write some javascript at the *end* of my rendered html page via my webform. currently i am using response.write and it always puts it at the top of my page. using RegisterClientScriptBlock seems to put it just after the VIEWSTATE bit at the top. any help appreciated. thanks. t....

  1. #1

    Default output javascript to appear at end of page?

    hi,

    i want to write some javascript at the *end* of my
    rendered html page via my webform.

    currently i am using response.write and it always
    puts it at the top of my page.

    using RegisterClientScriptBlock seems to put it
    just after the VIEWSTATE bit at the top.

    any help appreciated.

    thanks.

    t.


    Tariq Ahmad Guest

  2. #2

    Default Re: output javascript to appear at end of page?

    I believe Page.RegisterStartupScript does what you are looking for.

    Karl


    "Tariq Ahmad" <tariqnahmadhotmail.com> wrote in message
    news:O3ieeV6RDHA.3700tk2msftngp13.phx.gbl...
    > hi,
    >
    > i want to write some javascript at the *end* of my
    > rendered html page via my webform.
    >
    > currently i am using response.write and it always
    > puts it at the top of my page.
    >
    > using RegisterClientScriptBlock seems to put it
    > just after the VIEWSTATE bit at the top.
    >
    > any help appreciated.
    >
    > thanks.
    >
    > t.
    >
    >

    Karl Seguin Guest

  3. #3

    Default Re: output javascript to appear at end of page?

    Here's an article that I wrote that explains the placement and use of
    codebehind for emitting client-side script:

    [url]http://www.fawcette.com/vsm/2002_07/magazine/columns/aspnet/default_pf.asp[/url]

    [url]http://www.fawcette.com/vsm/2002_07/magazine/columns/aspnet/table1.asp[/url]

    Ken

    "Tariq Ahmad" <tariqnahmadhotmail.com> wrote in message
    news:O3ieeV6RDHA.3700tk2msftngp13.phx.gbl...
    hi,

    i want to write some javascript at the *end* of my
    rendered html page via my webform.

    currently i am using response.write and it always
    puts it at the top of my page.

    using RegisterClientScriptBlock seems to put it
    just after the VIEWSTATE bit at the top.

    any help appreciated.

    thanks.

    t.



    Ken Cox [Microsoft MVP] Guest

  4. #4

    Default Re: output javascript to appear at end of page?

    BTW, you should not be using Response.Write for anything. It is deoprecated,
    procedural in nature, and exists merely for backwards-compatibility for the
    most part, unless you're writing a custom HttpHandler.

    --
    HTH,

    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    [url]http://www.takempis.com[/url]
    Big things are made up
    of lots of little things

    "Tariq Ahmad" <tariqnahmadhotmail.com> wrote in message
    news:eiXK$86RDHA.1324TK2MSFTNGP11.phx.gbl...
    >
    > excellent articles - thanks!
    >
    > "Ken Cox [Microsoft MVP]" <BANSPAMken_coxsympatico.ca> wrote in message
    > news:eTIe2u6RDHA.1304TK2MSFTNGP11.phx.gbl...
    > > Here's an article that I wrote that explains the placement and use of
    > > codebehind for emitting client-side script:
    > >
    > >
    [url]http://www.fawcette.com/vsm/2002_07/magazine/columns/aspnet/default_pf.asp[/url]
    > >
    > > [url]http://www.fawcette.com/vsm/2002_07/magazine/columns/aspnet/table1.asp[/url]
    > >
    > > Ken
    > >
    > > "Tariq Ahmad" <tariqnahmadhotmail.com> wrote in message
    > > news:O3ieeV6RDHA.3700tk2msftngp13.phx.gbl...
    > > hi,
    > >
    > > i want to write some javascript at the *end* of my
    > > rendered html page via my webform.
    > >
    > > currently i am using response.write and it always
    > > puts it at the top of my page.
    > >
    > > using RegisterClientScriptBlock seems to put it
    > > just after the VIEWSTATE bit at the top.
    > >
    > > any help appreciated.
    > >
    > > thanks.
    > >
    > > t.
    > >
    > >
    > >
    >
    >

    Kevin Spencer Guest

  5. #5

    Default output javascript to appear at end of page?

    Use RegisterStartupScript it will work
    Unregistered Guest

Similar Threads

  1. How do you output the Euro symbol intext/HTML/Javascript?
    By BKBK in forum Coldfusion - Getting Started
    Replies: 7
    Last Post: November 21st, 05:22 PM
  2. JavaScript entered in a page blocks editing page inContribute
    By BentonD in forum Macromedia Contribute General Discussion
    Replies: 0
    Last Post: December 20th, 01:29 AM
  3. Output a query into simple Javascript
    By sjmyles in forum Macromedia ColdFusion
    Replies: 1
    Last Post: May 26th, 03:07 PM
  4. Trying to output pdf but get cfm page
    By Lemonizer 5000 in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: February 26th, 06:18 PM
  5. Replies: 0
    Last Post: November 9th, 02:17 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139