PDA

View Full Version : Automatic Refresh, not as easy as it sounds



Nicola
Oct 11th, 2001, 02:33 AM
Hi,
I want a page to refresh, I know I can do this with a metta HTTP. But the page needs only to be refreshed once when opening and not again as the content on the page can be edted, if the page keeps refreshing you loose the changes.
The page is an asp page.
Whats more it is asp which calls on specific ID, so simply putting in a response.redirect directs it to the page without the relevant info.
Can anyone help?:confused:

Tommy
Oct 11th, 2001, 03:02 AM
Can I just clarify that you want to reload the page once when it is opended?

If so then you can do this with ASP; set a counter to check whether the response.redirect has been called. If not, run the code, otherwise just ignore.



Originally posted by Nicola

Whats more it is asp which calls on specific ID, so simply putting in a response.redirect directs it to the page without the relevant info.



If this is the problem then post the info along with the page in a form.

Nicola
Oct 11th, 2001, 03:22 AM
mmmmmm....I have pasted all manner of asp scrips on the page and nothing helps.Let me try to explain a bit better.
the page with the problem is called view vacancy. depending on where you come from on the site you can either
write a new vacancy or edit a current one (information called from a mdb file.) If you edit a current vacancy and save it, you are redirected to a vacancy board where you can view the changes. if you request to edit the page again, the page loads and the saved changes are not apparent, until you press the refresh button. I think i need a script like the refresh button to work when the page loads if such a script exists.
Does this help explain my problem? Can you explain any help in lay-mans terms plse!

Mr Chunder
Oct 11th, 2001, 04:11 AM
Ok Nicola, you should never have to mess about with forced refreshes or anything like that. Your app sounds like a standard ASP forms apps so lets work through it.

The screen flow is as follows:

lists of current vacancies -> edit a vacancy/save changes -> review changes -> edit a vacancy (again!)

But, on the edit again screen, you do not see the changes previously made (form is blank presumably) unless you do a refresh.

This could be to with the structure of the edit form i.e. does it know its state - submitted or not.

Is the edit form loading data from the mdb on startup and then posting to itself to do the saves ?

Nicola
Oct 11th, 2001, 04:31 AM
Theform is not blank, on editing the form, the correct ID is called. The vacancy is displayed but the changes are not there eg
Vacancy reads ->web designer ->edit to 'young web designer -> save and you are directed back to a list which shows the alteration -> edit again and you go back to the vacancy, but it displays 'web designer' until you click refresh, then 'young web designer' is displayed.
The changes are saved on the mdb file and logging on to a different computer all changes are seen.

Mr Chunder
Oct 11th, 2001, 05:22 AM
Still sounds like a form state problem.

After an edit is done and BEFORE the screen where you can review changes, does the form save its data to mdb and then the review page loads it from the mdb OR, does the edit screen just post them to the review screen with no interaction with the DB ?

Nicola
Oct 11th, 2001, 06:02 AM
the review page loads from the mdb........

Mr Chunder
Oct 11th, 2001, 06:21 AM
Ok, then does the edit page ALWAYS load from the database i.e. are their any "if submitted" etc. type statements that would prevent it running the load from database code and instead display the original ?

The browser is displaying the page from the cache but it does not make much sense since I would expect it to display the data when it was last entered. It could be displaying the contents of old session variables.

Granted something odd is taking place. Can you please email/private message me the asp code for the edit page please. I'll take a look and then get back to you.

Mr Chunder
Oct 11th, 2001, 07:25 AM
Nicola, Thanks for the PM/url

I couldn't see the source code for the asp as obviously your server executes it !

However, I can't see anything wrong. I edited the record, hit save, was taken to the list, I hit view and then was shown the latest record. I did this several times with a few hits of the back button and couldn't see it go wrong !

Do you get the same result from multiple browsers ? I reckon that you have the wrong setting on your own personal browser. On your browser, goto tools -> internet options -> general tab.

On this tab in the middle there should be "Temp Internet Files". Click on the settings button and on the "Check for newer versions of stored pages", ensure that the radio button is set to "Automatic". These instructions apply to IE 5.5 SP2.

Ok, how did you do ?

Nicola
Oct 11th, 2001, 07:36 AM
nope, that doesn't work either. my machine is set to automatic. Tried from all machines in the office, all set the same, still does notshow the new version on re-edit. The client is having the same problem too.......
have any other ideas?
Thanks againxx ;)

Nicola
Oct 11th, 2001, 07:55 AM
I think, after the headaches i've been havin, it may be down to our proxy!!!!!(sudden brainwave, just a shame it didn't happen sooner!) Sorry :rolleyes:

Mr Chunder
Oct 11th, 2001, 07:58 AM
You haven't answered me about the fact that I couldn't see it going wrong -

I'll repeat - I edited the record - e.g. change "account manager" to "account manager test", hit save, was taken to the list, I hit view and then was shown the latest record - complete with my edit.

Whats wrong with that ?

A thought has occurred - do you have direct access to your webserver like I do or are you going through a proxy server with caching. Sometimes people on AOL get this problem because AOL caches half the internet (uselessly !) so they get to look at out of date pages.

Also, does your client access the web directly, again like with my setup ?

Mr Chunder
Oct 11th, 2001, 08:14 AM
Ha ha. Got there in the end. Right, I'm off for a coffee !