Click to See Complete Forum and Search --> : Submitting Page


rathnadevil
September 6th, 2002, 01:17 PM
Hi,
I'm using an ASP page(exmple - say firstpage.asp) to add new record to table. I submit this page to another asp page(say secondpage.asp) which contains the query to insert the entered values(no html code there). no form tag is there. Now I want to go to first page. Without click, I want to go to first page.

Otherwise, pls suggest me to do the alternate for inserting new record in the samepage(firstpage.asp)

Zvona
September 8th, 2002, 07:31 AM
An example :

<%
If Request("insert") Then
' Commit SQL clause
End If
%>
<html>
<head>
.
.
.
</head>
<body>
<form action="firstPage.asp" method="post">
<input type="hidden" name="insert" value="true" />
.
.
<input type="submit" value="Execute SQL" />
</form>
</body>
</html>
Now, SQL clause is only executed when form is posted. Note, if user refreshes page, SQL clause is re-executed. Thus, you should use a session variable, which tells that SQL clause is already executed.

If you need help with Session object, please reply and I'll help you further.