Link to home
Start Free TrialLog in
Avatar of Aurokripa
Aurokripa

asked on

is any alternative of "history.back()" in ASP?

hello expert,
 i am working in web site development for b2b application in ASP. In this application i am facing one problem as follow:
      There is one form for Customer Master. In this form i ask user to give User Name, Password, First Name etc. Now on submit button i check database for Unique User Name. if user name is already exist then  i want to show same form with given data. Is there any function in ASP like " history.back() " in javascript.
      If you find any solution then give me reply as soon as possible . i am awaiting for your positive reply.

kamal
ASKER CERTIFIED SOLUTION
Avatar of FRehman
FRehman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Kamal you have to write Response.Buffer=True which FRehman missed.So your code will look something like this


<%
Response.Buffer=True
loginName=Request.QueryString("Uname")
pwd =Request.QueryString("pwd")
set Myconn=server.CreateObject("ADODB.connection")
Myconn.Open "DRIVER={MicroSoft Access Driver (*.mdb)};DBQ=" & server.MapPath("./website.mdb")
set rs=server.CreateObject("ADODB.recordset")
rs.open "Select * from Login where usrName='" &loginName& "' and pwd='" &pwd& "'" ,Myconn ,adOpenDynamic,adLockOptimistic
if  rs.eof then
rs.AddNew
rs.Fields("usrName")=loginName
rs.Fields("pwd")=pwd
rs.Update
else
response.rediect("previouspage.asp")
end if
%>


;->

Kunal
Avatar of ruperts
ruperts

Actually you don't need it if you don't write anything to the browser first!

Response.Buffer=True