<body onload="myScript()"> should do.

Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
> Hi all,
>
[quoted text clipped - 4 lines]
>
> Bill
> 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>

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Bill - 15 Oct 2007 15:53 GMT
> > 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)?
[quoted text clipped - 10 lines]
> 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?
Bill - 15 Oct 2007 15:54 GMT
> > 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)?
[quoted text clipped - 10 lines]
> 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?
Peter Bromberg [C# MVP] - 15 Oct 2007 16:16 GMT
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
> > > 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)?
[quoted text clipped - 19 lines]
> update it with a script which ran every time a user came to the page.
> Would that be possible?
Bill - 15 Oct 2007 16:28 GMT
On Oct 15, 10:16 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yohohhoandabottleofrum.com> wrote:
> Bill,
> I believe you may be confusing the concept of "running a script" with what
[quoted text clipped - 40 lines]
> > 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