?
Solved

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

Posted on 2000-03-30
3
Medium Priority
?
264 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 150 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

764 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