473,587 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Register client script at the end of the page.

Hello,

I want that the client script is added at the and of the HTML output it is
now at the beginning.

Here is my code:
private void Page_Load(objec t sender, System.EventArg s e)
{
RegisterClientS cript();
}

/// <summary>
/// Registers ClientScript with the Page.
/// </summary>
protected virtual void RegisterClientS cript() {
if( !Page.IsClientS criptBlockRegis tered("PortalIC T.WebControls.D CE
Library") ) {

ResourceManager manager = new ResourceManager ( typeof(RichText Box) );
String script =
manager.GetReso urceSet(System. Globalization.C ultureInfo.Curr entCulture,
true, true).GetString ("LibraryScript ");

this.Page.Regis terClientScript Block("PortalIC T.WebControls.D CE Library",
script );
}
}

What do I have to change?

Thanks!
Nov 17 '05 #1
2 11410
Instead of RegisterClientS criptBlock, use RegisterStartup Script.
RegisterStartup Script puts the script block just above the </form> tag in
the page.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"Arjen" <bo*****@hotmai l.com> wrote in message
news:bh******** **@news2.tilbu1 .nb.home.nl...
Hello,

I want that the client script is added at the and of the HTML output it is
now at the beginning.

Here is my code:
private void Page_Load(objec t sender, System.EventArg s e)
{
RegisterClientS cript();
}

/// <summary>
/// Registers ClientScript with the Page.
/// </summary>
protected virtual void RegisterClientS cript() {
if( !Page.IsClientS criptBlockRegis tered("PortalIC T.WebControls.D CE
Library") ) {

ResourceManager manager = new ResourceManager ( typeof(RichText Box) );
String script =
manager.GetReso urceSet(System. Globalization.C ultureInfo.Curr entCulture,
true, true).GetString ("LibraryScript ");

this.Page.Regis terClientScript Block("PortalIC T.WebControls.D CE Library", script );
}
}

What do I have to change?

Thanks!

Nov 17 '05 #2
Okay, thanks!
"Kevin Spencer" <ke***@takempis .com> schreef in bericht
news:OB******** *****@TK2MSFTNG P10.phx.gbl...
Instead of RegisterClientS criptBlock, use RegisterStartup Script.
RegisterStartup Script puts the script block just above the </form> tag in
the page.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"Arjen" <bo*****@hotmai l.com> wrote in message
news:bh******** **@news2.tilbu1 .nb.home.nl...
Hello,

I want that the client script is added at the and of the HTML output it is now at the beginning.

Here is my code:
private void Page_Load(objec t sender, System.EventArg s e)
{
RegisterClientS cript();
}

/// <summary>
/// Registers ClientScript with the Page.
/// </summary>
protected virtual void RegisterClientS cript() {
if( !Page.IsClientS criptBlockRegis tered("PortalIC T.WebControls.D CE
Library") ) {

ResourceManager manager = new ResourceManager ( typeof(RichText Box) ); String script =
manager.GetReso urceSet(System. Globalization.C ultureInfo.Curr entCulture,
true, true).GetString ("LibraryScript ");

this.Page.Regis terClientScript Block("PortalIC T.WebControls.D CE

Library",
script );
}
}

What do I have to change?

Thanks!


Nov 17 '05 #3

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

Similar topics

1
1752
by: Darren Clark | last post by:
How does everyone register and access input objects on the client side? well... i suppose i am after some alternate ways... i use the following code to put the neccessary client javascript code so that i can then use them later... private void RegisterClientObjects() { System.Text.StringBuilder sBuild = new System.Text.StringBuilder();
2
8154
by: Hardy Wang | last post by:
Hi, I have a page which will call RegisterStartupScript function to register a client script. I also need to remove it under some certain condition, is there a way? -- WWW: http://hardywang.1accesshost.com ICQ: 3359839 yours Hardy
3
7746
by: Hardy Wang | last post by:
Hi, By calling Page.RegisterClientScriptBlock, the JavaScript will be generated right after VIEWSTATE hidden field. Is there a way I can register my script to end of page instead beginning? -- WWW: http://hardywang.1accesshost.com ICQ: 3359839 yours Hardy
3
2276
by: Goh | last post by:
Hi, May I know how to register a java script inside the <head> tag not the body? I found only got method that able register at the body like RegisterStartupScript and RegisterClientScriptBlock. I would like to register this script inside user control. and this script must be run when the page is load. Got any method that able to call to...
2
4878
by: fredd00 | last post by:
Hi here is my problem i use master pages and content pages i would like for some content page to register a script that will trigger on the 'onUnload' of the web page
1
2131
by: lourivas | last post by:
Hi, I create a class with a property called MyProperty that needs to register a client script if the value is set to true. When i change the property value to true i always receive a message "Property value is not valid/Object reference not set to an instance of an object". I'm using VS 2005. What i'm missing? see:
6
2903
by: Velislav | last post by:
Hi, I have a client script block, which is registered in my Page_Load. However a button may result in the need to change the script which I've registered. Obviously the OnClick event occurs after Page_Load, so calling RegisterClientScriptBlock with the same key does nothing.
3
7881
by: dixonjm | last post by:
Hi, In my page load event i have:- RegisterClientScripts(); if (!Page.IsClientScriptBlockRegistered("BannerScript")) if (!IsPostBack) { _userLink.Attributes.Add("onclick", string.Format("ShowPopupWindow('UserWindow');")); }
2
1253
by: Ed Courtenay | last post by:
Reposting here as you can practically see the tumbleweed blow by in microsoft.public.dotnet.framework.aspnet.webcontrols.... I've got a very simple custom control that requires a small section of JavaScript to function at the client - nothing out of the ordinary. In the overridden RenderContents method of my custom control I check whether...
0
7923
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8216
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.