By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,384 Members | 845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,384 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
<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

P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.