Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill - 15 Oct 2007 15:35 GMT
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
Eliyahu Goldin - 15 Oct 2007 15:42 GMT
<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
Mark Rae [MVP] - 15 Oct 2007 15:47 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)?

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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.