473,406 Members | 2,954 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,406 software developers and data experts.

script block added by the RegisterStartupScript

Hi,

In this article,

http://msdn2.microsoft.com/en-us/library/asz8zsxy.aspx#

It mentioned

The script block added by the RegisterStartupScript method executes
when the page finishes loading but before the page's OnLoad event is
raised.

I created a simple web project with a button control only, in
Button1_Click method, I registered
a javascript block which is just a alert.

When I click button, the Page_Load happens first, and then
Button1_Click, then alert message box comes out. Before I read the
article, I never have any question about this sequence, since script is
only registered when button click even is handled, which always after
Page_Load.

Could someone get me some idea why the article says "when the page
finishes loading but before the page's OnLoad event is raised"

Thanks

zhuang

Oct 26 '06 #1
0 937

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

Similar topics

2
by: Arjen | last post by:
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(object sender, System.EventArgs e) {...
6
by: Bart Schelkens | last post by:
Hi, how can I execute a piece of Java-script after a piece of vb-net-code has been executed? Thx
9
by: Harry Smith | last post by:
While reading the documentation on IsStartupScriptRegistered, there is a reference to "client startup script" as "Determines if the client startup script is registered with the Page object." What...
6
by: ruca | last post by:
Hi, Can I call two script blocks for different languages in my ASP.NET code? I have a button than when clicked it must open a popup window to return some values for two other controls that I...
3
by: MW de Jager | last post by:
I am running a script from C#, but I need a returnvalue to be passed back to my code. I am currently using RegisterStartupScript, but this does not allow me to receive anything back from the...
6
by: simon | last post by:
hello, what code would i use to kick off a javascript script after i had registered it? If (Not Page.IsClientScriptBlockRegistered("jsScript")) Then Page.RegisterClientScriptBlock("jsScript",...
4
by: Alex Maghen | last post by:
When I do this in my page... ClientScript.RegisterStartupScript(this.GetType(), "SomeScript", "alert(\"Hi there\");"); it doesn't work AND when I view source, the alert() line is dumped into the...
1
by: RSH | last post by:
I have a situation where I am Registering a Startup script with the following code: If Not IsPostBack Then Dim sScript As StringBuilder = New StringBuilder sScript.Append("<SCRIPT...
2
by: Ralf | last post by:
Using .NET 1.1, vb code behind. I have a project and I have been opening new windows throughout it. I need them opened on top of the parent, and be able to minimize or go back to the parent if...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.