output javascript to appear at end of page?

Ask a Question related to ASP.NET General, Design and Development.

  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. Similar Questions and Discussions

    1. How do you output the Euro symbol intext/HTML/Javascript?
      Inserting the euro symbol causes problems. Some users report that they get a question mark, others that they get a little square. The problem...
    2. JavaScript entered in a page blocks editing page inContribute
      I have entered a set of JavaScript tags into a html page via FTPand the page displays correctly on the web. When I go to Contribute to and attempt...
    3. Output a query into simple Javascript
      Hi I have a query the results of which I'd like to use in Javascript to form the items in a dynamic menu.... eg i run query with results.....
    4. Getting page output
      Is there a tag or method I can use to grab the page output so that I can amend it prior to outputting.
    5. output text in control location; calling control javascript from page javascript
      Hi; If you don't know, I'm just learning javascript and aspnet, but I have a pretty good grounding in windows programming. I'm trying to build a...
  3. #2

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

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

    Karl


    "Tariq Ahmad" <tariqnahmad@hotmail.com> wrote in message
    news:O3ieeV6RDHA.3700@tk2msftngp13.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

  4. #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" <tariqnahmad@hotmail.com> wrote in message
    news:O3ieeV6RDHA.3700@tk2msftngp13.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

  5. #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" <tariqnahmad@hotmail.com> wrote in message
    news:eiXK$86RDHA.1324@TK2MSFTNGP11.phx.gbl...
    >
    > excellent articles - thanks!
    >
    > "Ken Cox [Microsoft MVP]" <BANSPAMken_cox@sympatico.ca> wrote in message
    > news:eTIe2u6RDHA.1304@TK2MSFTNGP11.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" <tariqnahmad@hotmail.com> wrote in message
    > > news:O3ieeV6RDHA.3700@tk2msftngp13.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

  6. #5

    Default output javascript to appear at end of page?

    Use RegisterStartupScript it will work
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may 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