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

Run a script *every time* whether postback is true or not

Hi all,

How would I set up a script to run every time a user comes to a page
(even if they come to the page via the back button)?

Thanks!

Bill

Oct 15 '07 #1
6 1682
<body onload="myScript()"should do.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Bill" <an*********@gmail.comwrote in message
news:11*********************@z24g2000prh.googlegro ups.com...
Hi all,

How would I set up a script to run every time a user comes to a page
(even if they come to the page via the back button)?

Thanks!

Bill

Oct 15 '07 #2
"Bill" <an*********@gmail.comwrote in message
news:11*********************@z24g2000prh.googlegro ups.com...
How would I set up a script to run every time a user comes to a page
(even if they come to the page via the back button)?
A script? Do you mean a piece of JavaScript?

<head>
<script type="text/javascript">
alert('Hello');
</script>
</head>
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 15 '07 #3
On Oct 15, 9:47 am, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Bill" <antiiner...@gmail.comwrote in message

news:11*********************@z24g2000prh.googlegro ups.com...
How would I set up a script to run every time a user comes to a page
(even if they come to the page via the back button)?

A script? Do you mean a piece of JavaScript?

<head>
<script type="text/javascript">
alert('Hello');
</script>
</head>

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
Yes, JavaScript can be called that way, but I'm afraid that's not what
I need.

Let me be more specific: I have a datagrid that I want to update every
time the user comes to the page (including the back button). So far
I've been unsuccessful with this but I was hoping I could somehow
update it with a script which ran every time a user came to the page.
Would that be possible?

Oct 15 '07 #4
On Oct 15, 9:47 am, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Bill" <antiiner...@gmail.comwrote in message

news:11*********************@z24g2000prh.googlegro ups.com...
How would I set up a script to run every time a user comes to a page
(even if they come to the page via the back button)?

A script? Do you mean a piece of JavaScript?

<head>
<script type="text/javascript">
alert('Hello');
</script>
</head>

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
Yes, JavaScript can be called that way, but I'm afraid that's not what
I need.

Let me be more specific: I have a datagrid that I want to update every
time the user comes to the page (including the back button). So far
I've been unsuccessful with this but I was hoping I could somehow
update it with a script which ran every time a user came to the page.
Would that be possible?

Oct 15 '07 #5
Bill,
I believe you may be confusing the concept of "running a script" with what
happens when the browser caches a page and you hit the back button and get
the browser's version of the page rather than having it re-requested from
your website.

What you need to do is find the correct cache control settings to emit so
that your pages are not cached by the browser.

Here is an article that covers some caching basics:
http://www.eggheadcafe.com/articles/20060407.asp

-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Bill" wrote:
On Oct 15, 9:47 am, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Bill" <antiiner...@gmail.comwrote in message

news:11*********************@z24g2000prh.googlegro ups.com...
How would I set up a script to run every time a user comes to a page
(even if they come to the page via the back button)?
A script? Do you mean a piece of JavaScript?

<head>
<script type="text/javascript">
alert('Hello');
</script>
</head>

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net

Yes, JavaScript can be called that way, but I'm afraid that's not what
I need.

Let me be more specific: I have a datagrid that I want to update every
time the user comes to the page (including the back button). So far
I've been unsuccessful with this but I was hoping I could somehow
update it with a script which ran every time a user came to the page.
Would that be possible?

Oct 15 '07 #6
On Oct 15, 10:16 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yohohhoandabottleofrum.comwrote :
Bill,
I believe you may be confusing the concept of "running a script" with what
happens when the browser caches a page and you hit the back button and get
the browser's version of the page rather than having it re-requested from
your website.

What you need to do is find the correct cache control settings to emit so
that your pages are not cached by the browser.

Here is an article that covers some caching basics:http://www.eggheadcafe.com/articles/20060407.asp

-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Bill" wrote:
On Oct 15, 9:47 am, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Bill" <antiiner...@gmail.comwrote in message
>news:11*********************@z24g2000prh.googlegr oups.com...
How would I set up a script to run every time a user comes to a page
(even if they come to the page via the back button)?
A script? Do you mean a piece of JavaScript?
<head>
<script type="text/javascript">
alert('Hello');
</script>
</head>
--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
Yes, JavaScript can be called that way, but I'm afraid that's not what
I need.
Let me be more specific: I have a datagrid that I want to update every
time the user comes to the page (including the back button). So far
I've been unsuccessful with this but I was hoping I could somehow
update it with a script which ran every time a user came to the page.
Would that be possible?
Thank you. I will research what you've given me.

Bill

Oct 15 '07 #7

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

Similar topics

13
by: Ideasman | last post by:
Hi I have a made a script that process normals for a flat shaded 3D mesh's. It compares every vert with every other vert to look for verts that can share normals and It takes ages. I'm not...
6
by: Kenneth | last post by:
Hello, I'm having some serious problems debugging a script that I'm trying to make work. I'm working on a form where a user can type in a time (in the format of HH:MM), and another script...
3
by: Razvan | last post by:
Hello, Can somebody recommend me a Java Script scroller that can scroll an i-frame ? I tried the Tigra scroller (www.softcomplex.com/products/tigra_scroller/) but sometimes it does not...
3
by: Mike | last post by:
Hi, I am trying to resize a HTML table through Javascript. When the user control loads the first time, the table is resized, but then it doesn't anymore. I am using the following code in the...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
13
by: tshad | last post by:
Is there a way to run a script or function on entry of each page without having to put a call in each page? Periodically, I find something I want to do each time a page is entered and I have to...
9
by: Jerim79 | last post by:
Here it is: <?php if($_SERVER=='POST'){ $Number=$_POST; $Email=$_POST; $Number2=0; $error=0;
2
by: Jay | last post by:
I have a web app running on the windows CE device. In one of the asp.net pages - it has javascript code. That seems to have a memory leak. When I run the web app - in about one hour, the app hangs....
4
by: =?Utf-8?B?UGFycm90?= | last post by:
Is there any way to execute a javascript or any kind of script when responding to a SelectionChange event in a Calendar control? I would like to display a window containing dynamic data on top of...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.