Solved

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

Posted on 2000-03-30
3
262 Views
Last Modified: 2012-08-14
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
0
Comment
Question by:Aurokripa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Accepted Solution

by:
FRehman earned 50 total points
ID: 2668804
<%
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
      %>
0
 
LVL 4

Expert Comment

by:jkunal
ID: 2669107
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
0
 
LVL 4

Expert Comment

by:ruperts
ID: 2669901
Actually you don't need it if you don't write anything to the browser first!

Response.Buffer=True
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question