473,786 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript to call on MasterPage onload

I have a javascript function that i want to call masterpage load
method called. I cant add onLoad event of body or table in master
page.

I have put the call to script function in <form>, it works on every
pageLoad. seems my problem is solved. But when the pages uses
UpdatePanel and it gets asynchronously postback. the function call at
master page doesnt execute????? thought master page Load event gets
called even when pages are in updatePanel.

I want the particular function to be executed on every postback by
updatePanel.?/??

how can i do this..??

thanks for replies in advance.. it is urgent !

Nov 7 '07 #1
4 13034
on an async postback, only script registered in the update panel will be
executed. if you want to run on an async postback, then the update panel
should register a call to the function. also only script registered with
the ajax script manager will sent to the client and executed.

-- bruce (sqlwork.com)

faraz wrote:
I have a javascript function that i want to call masterpage load
method called. I cant add onLoad event of body or table in master
page.

I have put the call to script function in <form>, it works on every
pageLoad. seems my problem is solved. But when the pages uses
UpdatePanel and it gets asynchronously postback. the function call at
master page doesnt execute????? thought master page Load event gets
called even when pages are in updatePanel.

I want the particular function to be executed on every postback by
updatePanel.?/??

how can i do this..??

thanks for replies in advance.. it is urgent !
Nov 7 '07 #2
thanks for the reply.. i was wondering how would i attach the script
function call (function is in master page) with UpdatePanel of Page?..
and is there anything i can only with master page and have it on all
pages?...

Nov 7 '07 #3
You can define the script manager in your master page, then:

- Use the registerstartup script from script manager:

http://gotjeep.net/Blogs/CommentView...ecaf18fac.aspx

- If you want to call script manager from child pages or user controls use
the scriptmanagerpr oxy:

http://aspalliance.com/1285_Tip_and_...d_Master_Pages

http://aspadvice.com/blogs/name/arch...tent-Page.aspx
- If you want to launch some javascript after an update panel updates,
AJAX ASP .net expose some events for that, check out EndRequest event.

/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------


"faraz" wrote:
I have a javascript function that i want to call masterpage load
method called. I cant add onLoad event of body or table in master
page.

I have put the call to script function in <form>, it works on every
pageLoad. seems my problem is solved. But when the pages uses
UpdatePanel and it gets asynchronously postback. the function call at
master page doesnt execute????? thought master page Load event gets
called even when pages are in updatePanel.

I want the particular function to be executed on every postback by
updatePanel.?/??

how can i do this..??

thanks for replies in advance.. it is urgent !

Nov 7 '07 #4
thanks alot guys..EndReques t Event works ! .. I dont even have to
register the script with scriptManager. I just had to call the my
function in the UpdatePanel through EndRequest event.

thanks for such quick response. :)

Nov 7 '07 #5

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

Similar topics

9
2900
by: Robby Bankston | last post by:
I'm working on some code and am running into brick walls. I'm trying to write out Javascript with Javascript and I've read the clj Meta FAQ and didn't see the answer, read many similar posts (with no luck though), and searched through the IRT.ORG Faqs (www.irt.org/script/script.htm). The Javascript is designed to open an popup window and then inside that window call another script which will resize that window. There may be another...
1
2788
by: Daves | last post by:
I am using 2.0 masterpages. All content pages use some common variables, for example the DB connection string. Also some pages return links which are located in a "sublink" area in the masterpage. So the masterpage code would 1) create the public string DBConn and 2) check the public string SubLinks if it contains any links after the content page was run (if not, hide the sublink bar). Using Page_OnLoad event the masterpage code is run...
3
3044
by: Daves | last post by:
how can I set events other than Page_OnLoad for masterpage in 2.0? Because I need to have some code being run before the content page OnLoad event is run...
4
5235
by: E | last post by:
I am having trouble with setTimeout working on a second call to the setTimeout function from a second page which is an html page. Here is the scenario. I have a web page and onload it calls a javascript function which calls setTimeout and will process a second javascript function "Warn" just before the session expires. The Warn function displays an html page with a button. A second timer is started to cause the html page to close...
6
9568
by: pronerd | last post by:
Hi, I am trying to dynamically set an event handler across frames. I have no problems setting properties across frames doing something like parent.ToolMenuFrame.location.href = 'http://www.blah blah blah.com'; But when I try to set an event handler this way, as shown below, it fails. parent.ToolMenuFrame.window.document.body.onload = "alert('On Load Trigger Fired!!');"; parent.ToolMenuFrame.document.body.onload = "alert('On Load...
8
2609
by: Frank | last post by:
Hi, I am working with VS.NET 2005 Ultimately, I wish to call a JavaScript function from a .js file
2
9992
by: Kees de Winter | last post by:
In an ASP.NET 2.0 application using masterpages, how can I add a 'load' and 'unload' JavaScript function to the body tag for some aspx page that uses the masterpage. I don't want to add it to the masterpage because it's just for one page. Have a nice day Kees
5
3434
by: =?Utf-8?B?TWF0Y29u?= | last post by:
Hello, I have a asp.net 2.0 (vb.net) page, which uses a master page, and there is a javascript function (myfunction) defined in the <headof that master page. Is there a way to run the function from the page load event of the page? I am able to run the function when there is a change in, say, a text box, by adding the following to the page load event: TextBox.Attributes.Add("onChange", "javascript:myfunction()")
2
37698
Frinavale
by: Frinavale | last post by:
JavaScript in ASP.NET Using JavaScript in ASP.NET pages can make your application seem to work faster and prevent unnecessary calls to the server. JavaScript can be used to perform client-side functionality in the user's browser without having to make calls back to the server; thus, saving resources. The following example demonstrates how you can use an ASP.NET button to trigger a JavaScript call which modifies an ASP.NET TextBox. ...
0
9650
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
10164
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
10110
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
9962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8992
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
7515
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
6748
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4067
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
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.