Click to See Complete Forum and Search --> : [RESOLVED] Page not refreshing with updated data from DB


wylbur
08-04-2006, 09:14 PM
Hi,

I've got a base webpage that displays data from a datatable.
I've got a popup window that alters the data in the same datatable.
On that popup, I have a submit button. When the button is clicked,
it updates the datatable with the changes in the popup,
then places a JavaScript command on the webpage to call a function
that performs a postback/submit operation on the base webpage:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<script language="javascript"><!--

function CPST01_submit ()
{
var theform = document.Form_01;

//alert ('CPST01_submit ()');

theform.submit();
}
// -->
</script>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


It doesn't get any simpler than that.


When I click on the submit button, it updates the SQL Server 2005 datatable
(as I can see it from management studio), but the base page isn't updated
with the updated info - it still has the data as it was originally loaded.

When I pull up a second instance of the base webpage, it shows the updated data OK.

I placed an alert box in the submit function on the base page, and it was opened OK.

I made entries to a log file for verification with the controls that are to
display the correct data, and it shows that the right info is getting to the
web-controls.

On postback, however, the content doesn't change. This leads me to believe that
the page is being pulled from the browser cache - but of course I could be wrong.

I thought that perhaps ViewState might be resetting values back
to the original content. I've turned off ViewState, and I'm building
the page from scratch - whether it's on postback or not.

It didn't do any good.

Can anyone give me a clue as to why the page isn't being rendered as it should?


Thanks in advance!

wylbur
08-04-2006, 10:04 PM
I've been researching my problem, and I've found my own solution.

What I need to do is to use the RELOAD function in JavaScript
- NOT submit.

Problem resolved - and my thanks to all who have read this.