Solved

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

Posted on 2000-03-30
3
249 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 information …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

747 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now