473,394 Members | 1,739 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,394 software developers and data experts.

javascript only when not postback

I have an aspx page in Visual Studio 2005. I want to run a certain
javascript, but only if 'not postback'. ie: I only want the javascript to
run when the page loads for the very first time.

Is this possible?

Is there some way I can detect within the javascript if the page is being
loaded due to a PostBack or not?

Thanks in advance for any help,

Tom Edelbrok
Apr 20 '06 #1
2 2391
Tom,

Easy to do set a registerstartup in the load from your program and only in
the condition Not Ispostback

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

Be aware that the 1.x version is obsolete.

I hope this helps,

Cor

"Tom Edelbrok" <an*******@anonymous.com> schreef in bericht
news:yJQ1g.3404$fL.1128@edtnps90...
I have an aspx page in Visual Studio 2005. I want to run a certain
javascript, but only if 'not postback'. ie: I only want the javascript to
run when the page loads for the very first time.

Is this possible?

Is there some way I can detect within the javascript if the page is being
loaded due to a PostBack or not?

Thanks in advance for any help,

Tom Edelbrok

Apr 20 '06 #2
Works great! Thanks very much.

Tom


"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:eh**************@TK2MSFTNGP02.phx.gbl...
Tom,

Easy to do set a registerstartup in the load from your program and only in
the condition Not Ispostback

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

Be aware that the 1.x version is obsolete.

I hope this helps,

Cor

"Tom Edelbrok" <an*******@anonymous.com> schreef in bericht
news:yJQ1g.3404$fL.1128@edtnps90...
I have an aspx page in Visual Studio 2005. I want to run a certain
javascript, but only if 'not postback'. ie: I only want the javascript to
run when the page loads for the very first time.

Is this possible?

Is there some way I can detect within the javascript if the page is being
loaded due to a PostBack or not?

Thanks in advance for any help,

Tom Edelbrok


Apr 20 '06 #3

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

Similar topics

7
by: Michel | last post by:
Hi all, Is there some intelligent way to trigger a clientside JavaScript function before a postback is triggerd by any of the controls on a page? Thanks in advance, Michel Mathijssen
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
12
by: Mark Fox | last post by:
Hello, I am attempting to do something very simple. I have a page MainPage.aspx and a popup window Popup.aspx. When users click on the linkbutton in the popup window I am looking to do some...
2
by: Bruce W.1 | last post by:
There's something I can't figure out. I added some javascript behavior to my datagrid, just like in this article, except in C# instead of VB: ...
4
by: Matt Jensen | last post by:
Howdy all Hopefully I can explain my problem straightforwardly. In it's simplest explanation, what I want to do is have a hyperlink that, when clicked, executes some client side JavaScript and...
3
by: Wayne Sepega | last post by:
I have inherited from System.Web.UI.WebControls and overrode the OnRender of my new button. In the on render I generate some JavaScript and add it as an attribute as follows: ...
1
by: Veerle | last post by:
Hi, I have a web page and at the end of the page I have inserted some javascript that checks if Acrobat Reader plugin is installed. If it is not installed, I disable some elements (buttons,...
9
by: =?Utf-8?B?TWFyYyBXb29sZnNvbg==?= | last post by:
I have what seems to be a relatively simple problem when attempting to simulate a postback in ASP.NET from JavaScript. My scenario is (and please don't ask me why) that I have an HTML <a>nchor...
4
by: Peter | last post by:
ASP.NET I have an application which use ASP.NET Autocomplete extender which works great. But I have a question how to update all the fields on the screen using Ajax. Users starts typing in a...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.