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 can I update my DB without refreshing the browser window?

Status
Not open for further replies.

martindavey

Programmer
Jan 2, 2000
122
GB
Hope I'm not being stupid, but...<br>
<br>
How can I execute my ASP script which updates my DB without actually loading the page into the browser window?<br>
<br>
I want the user to click a button on my page and then my Access DB is updated with my ASP script (or otherwise).<br>
<br>
Upon completion of the SQL, I don't want a page returned from the server.<br>

 
Have the form submit to the same page. at the very top of the page, have an IF that checks if the button has been pressed.. then do your DB stuff and a Response.End in the If Clause. This only works well if the Response.Buffer IS NOT set to True. The HTTP header will be sent back but that is all. If you want to stop something dead in it's tracks Response.End will do it. <br>
<br>
If you do not put a Response.End in the IF statement at the top, then it will just show the same page &quot;same effect as no page.&quot; <br>
<br>
There may be an exact way to do it, but I'm not an ASP buff yet. Just tossing in my two cents.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top