473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Can I get RegisterClientScriptBlock to Appear at the end?

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
Nov 19 '05 #1
3 1329
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

Nov 19 '05 #2
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

Nov 19 '05 #3
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" <No************@comcast.netNoSpamM> wrote
in message news:9D**********************************@microsof t.com...
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

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mark | last post by:
I'm really pulling my hair out on this. (newbie at ASP.NET) I have a control (called 'header.ascx' ) that I want to place a DHTML(javascript) menu in. I keep getting errors. The menu code is...
2
by: sam | last post by:
I am trying to emit script to the response stream within the Application_Error handler in global.asax. I want to emit using Page.RegisterClientScriptBlock. This doesn't work, and I have been...
0
by: pealy2 | last post by:
A quick pointer to anyone struggling with the RegisterClientScriptBlock function, unless you already have a <FORM> section in your page then the script will not be added. I use vb code to...
3
by: | last post by:
Hello, I try to open a new Window in code behind with : ClientScript.RegisterClientScriptBlock(this.GetType(), "MyOpenScript", "window.open('toto.doc');", true); My problem is that the new...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.