473,800 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page.RegisterCl ientScriptBlock v Page.RegisterSt artupScript

Is there a difference between Page.RegisterCl ientScriptBlock and
Page.RegisterSt artupScript? I've seen them both in code examples and
they both seem to be doing the same thing.

Any help would be really appreciated.
Cheers,

Mike
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
3 8506
only where the script block will be placed in the html output differs. try
and see youself.
Nov 17 '05 #2
> Is there a difference between Page.RegisterCl ientScriptBlock and
Page.RegisterSt artupScript? I've seen them both in code examples and
they both seem to be doing the same thing.

Any help would be really appreciated.
Cheers,

Mike
*** Sent via Developersdex http://www.developersdex.com ***


RegisterClientS criptBlock is meant for functions that should
be "available" to the page. For this they are rendered at the start
of the HTML file.

RegisterStartup Script is meant for commands that should execute on
page load (at the client), so tha page needs to be available for the
script. This script is rendered at the end of the HTML file.

Hans Kesting
Nov 17 '05 #3
RegisterStartup Script puts the code just before the </form> tag, while
RegisterClientS criptBlock puts it at the top. Other than that, as "The Crow"
mentioned, there is no difference.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"The Crow" <q> wrote in message
news:eD******** ******@TK2MSFTN GP12.phx.gbl...
only where the script block will be placed in the html output differs. try
and see youself.

Nov 17 '05 #4

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

Similar topics

2
11421
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) { RegisterClientScript(); }
1
2929
by: Mark | last post by:
I've been reading the following link : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html /aspnet-injectclientsidesc.asp That supposedly tells you how to use these: RegisterStartupScript() and RegisterClientScriptBlock() to inject client side script into a server control. I'm new to ASP.NET and am hoping someone can help. I'm trying to get this snippet: <script language="JavaScript1.2"...
5
10078
by: Earl Teigrob | last post by:
I am creating an application where I would like to give web designers the ablity to create a static html page and dyanamically load it into my application(exactly like loading a user control into a page). Is there an easy way to do this or do I need to stream the html into my application and parse unwanted header/footer info before rendering it within the application page (as a literal control, i imagine) Has anyone done this or seen any...
4
1817
by: Robert Zurer | last post by:
When I click a Button server control I want two things to happen. The server returns a string array of error messages. A Javascript alert appears showing the errors. I can do this using the following method public void ShowErrorWindow(string errors) { string alertString = null;
3
1577
by: Kent Ogletree | last post by:
I need to get some JavaScript values onto an aspx page and I am not finding anything using Google. (probably not stumbled onto the right keywords) The code behind has the object that conatins the info I need to get onto the page. In old asp I would usually do: var someStringValue = "<% = MyStringVar %>"; However everything I try right now has done nothing more than break the page.
4
2072
by: jef | last post by:
Experienced programmer but new to Web development and ASP.NET. I'm attempting to implement a popup window by way of using the Page.RegisterStartupScript method in my VB code-behind logic (in a button click event). However, the RegisterStartupScript method doesn't show up as a valid method (neither does RegisterClientScriptBlock). What am I missing? When I type "Page." the IntelliSense drop-down list doesn't show them as options... any...
2
3195
by: Mark | last post by:
Hi - I have a component, which sends some Javascript to the page. I have a registerclientscriptblock which writes some Javascript which when the page is loaded, references a textbox written to the page by the component. However, my javascript gets written to the page before the components javascript, so when my script runs, the textbox being referenced doesn't exist yet.
4
4167
by: Filip De Backer | last post by:
Hi everyone, string script = ""; script += "<script language='javascript'>"; script += "window.open('showdoc.aspx');"; script += "</script>"; Response.Write(script); After the execution of this code, the layout of my aspx page changes: the font gets bigger, the datagrid (font, grid) gets bigger, ...
2
2473
by: Keith G Hicks | last post by:
I have a fairly long page with a submit button, a validation summary and a status label at the bottom of the page. I need it to go back to the bottom after the post so that the user can see any status information. I found some code that is supposed to do this but I cannot get it to work. it compiles and runs but does not move me down to the bottom fo the page. Here's my VB code that runs at the end of a sub where I post data back to the...
0
9691
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10276
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9090
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7580
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
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.