Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to refresh screen via scripting? 1

Status
Not open for further replies.

Frank123

MIS
Sep 17, 2001
77
US
I posted below on adding a new record to a grid using a "add" button. I got my program to add the information to the access database, but I can't get my screen to refresh when the button is pressed. So at the time, when I hit the "add" button, a record is added to the database but the grid doesn't change until you manually hit page refresh button. I tried putting in thispage.refresh, grid.close/grid.open but nothing seems to work. Thanks for your time. :)
 

maybe you could use response.redirect("yourpage.asp") after you add a record. I don't know of any other way to refresh a page in script.
 
In client side script you simply use:

<script language=&quot;javascript&quot;>
function reloader(){
window.location.reload();
}
</script>

You may want to add the no cache option to the page too:

<%
'at the top
Response.addHeader &quot;Pragma&quot;,&quot;No-cache&quot;
Response.expires = 0
%>

Hope this helps,

d4v1d5e
 
The recordset needs to be re-queried in order for the grid to show new records. As this happens on the server side - so add the record then requery the recordset, and the grid should be drawn with the new item.

If this is not working, then check the order of prosessing by turning on the trace facility, and maybe adding a few responce.writes . The recordset changes must occur before the grid is drawn. (Content Management)
 
Thanks for everyones advice. I eventually just added a response.redirect and everything worked out well. Thank U
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top