Can I get RegisterClientScriptBlock to Appear at the end?

  • Thread starter Thread starter Paul D. Fox
  • Start date Start date
P

Paul D. Fox

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
 
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 said:
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top