473,573 Members | 3,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

history -1

I need to make a response.redire ct that will take the user back 2 pages
after they login.

How can i implement this into response.redire ct ?

Thanks
May 19 '06 #1
12 2314
Jeff wrote:
I need to make a response.redire ct that will take the user back 2
pages after they login.

How can i implement this into response.redire ct ?

It can't be done without saving the pages in a hidden field. The server
knows nothing about the client history.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 19 '06 #2
So there is no way to have on the login page somewhere that says like

past = history.go(-2)

then have <% response.redire ct "&past&"%>

or, could i have the login page, after a good login, go to a page that just
has the history.go(-3)


"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Jeff wrote:
I need to make a response.redire ct that will take the user back 2
pages after they login.

How can i implement this into response.redire ct ?

It can't be done without saving the pages in a hidden field. The server
knows nothing about the client history.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

May 19 '06 #3
Has to be a client side redirect
At the end of your routine create a javascript function to handle this
<%
If code works then
%>
<script>
{
window.history. go(-2);
}
</script>
<%
else
end if
%>

"Jeff" <gi*****@adelph ia.net> wrote in message
news:S8******** *************** *******@adelphi a.com...
I need to make a response.redire ct that will take the user back 2 pages
after they login.

How can i implement this into response.redire ct ?

Thanks

May 19 '06 #4
Jeff wrote:
So there is no way to have on the login page somewhere that says like

past = history.go(-2)

If this is supposed to be server-side code, then no. The server knows
nothing about the client history.
See a client-side newsgroup such as m.p.scripting.j script for help with
populating a hidden field on a form with the items in history (perhaps in an
xml string, but not required).

Server-side code can read the contents of the hidden field and do what needs
to be done.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 19 '06 #5
Jeff wrote:
So there is no way to have on the login page somewhere that says like

past = history.go(-2)

then have <% response.redire ct "&past&"%>

or, could i have the login page, after a good login, go to a page
that just has the history.go(-3)


I take it back. There is a way to do it in server-side code: write a
client-side script block to the Response. Air code:

<%
If successfulLogin then
response.write "<script type=""text/javascript"">
response.write "history.go (-2);</script>
end if
%>

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 19 '06 #6
Thanks bob. This is working.. sortof. Here is the delema.

I have a report page with this at the top

if session("logged in")<>1 then response.redire ct "login.asp"

the login script sets the session to 1 if they are logged in, and lets them
view this page. if it isn't 1, then it sends them to the login page.

the problem is this, when it goes back 2 in history, it skips over that
report page, and goes to the page that I clicked report on. if i set it
to -1, it goes back to the login page. so it is missing the page that
redirected it to begin with.

am i doing something wrong?

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Jeff wrote:
So there is no way to have on the login page somewhere that says like

past = history.go(-2)

then have <% response.redire ct "&past&"%>

or, could i have the login page, after a good login, go to a page
that just has the history.go(-3)


I take it back. There is a way to do it in server-side code: write a
client-side script block to the Response. Air code:

<%
If successfulLogin then
response.write "<script type=""text/javascript"">
response.write "history.go (-2);</script>
end if
%>

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

May 19 '06 #7
If Session("logged in")<>1 Then
Session("redire ct") = Request.ServerV ariables("SCRIP T_NAME")
Response.Redire ct "login.asp"
End If

Then in the login page, on successful log in:

If Session("redire ct")<>"" Then
redirectpage = Session("redire ct")
Session("redire ct")=""
Response.Redire ct redirectpage
End If

--
Mike Brind

Jeff wrote:
Thanks bob. This is working.. sortof. Here is the delema.

I have a report page with this at the top

if session("logged in")<>1 then response.redire ct "login.asp"

the login script sets the session to 1 if they are logged in, and lets them
view this page. if it isn't 1, then it sends them to the login page.

the problem is this, when it goes back 2 in history, it skips over that
report page, and goes to the page that I clicked report on. if i set it
to -1, it goes back to the login page. so it is missing the page that
redirected it to begin with.

am i doing something wrong?

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Jeff wrote:
So there is no way to have on the login page somewhere that says like

past = history.go(-2)

then have <% response.redire ct "&past&"%>

or, could i have the login page, after a good login, go to a page
that just has the history.go(-3)


I take it back. There is a way to do it in server-side code: write a
client-side script block to the Response. Air code:

<%
If successfulLogin then
response.write "<script type=""text/javascript"">
response.write "history.go (-2);</script>
end if
%>

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


May 19 '06 #8
Jeff wrote:
Thanks bob. This is working.. sortof. Here is the delema.

I have a report page with this at the top

if session("logged in")<>1 then response.redire ct "login.asp"

the login script sets the session to 1 if they are logged in, and
lets them view this page. if it isn't 1, then it sends them to the
login page.
the problem is this, when it goes back 2 in history, it skips over
that report page, and goes to the page that I clicked report on. if i
set it to -1, it goes back to the login page. so it is missing the page
that
redirected it to begin with.

am i doing something wrong?

No, that's the problem with using History, which can cause pages to be
retrieved from the browser cacne rather than being re-requested from the
server.

You need to rethink what you are doing. At the very least, store the name of
the page you need to go back to in a session variable. Consider using
Server.Transfer instead of Response.Redire ct to prevent pages from being
retrieved from the browser cache.

if session("logged in")<>1 then
session("PageWh ereAuthFailed") = "me.asp"
response.redire ct "login.asp"
end if

in login.asp:
if SuccessfulLogin then
session("logged in")=1
pageForm = session("PageWh ereAuthFailed")
session("PageWh ereAuthFailed") = ""
if len(pageFrom)>0 then
Server.Transfer (pageFrom)
else
'do the default action
end if
end if

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 19 '06 #9
Jeff wrote on 19 mei 2006 in microsoft.publi c.inetserver.as p.general:
hanks bob. This is working.. sortof. Here is the delema.

I have a report page with this at the top

if session("logged in")<>1 then response.redire ct "login.asp"

the login script sets the session to 1 if they are logged in, and lets
them view this page. if it isn't 1, then it sends them to the login
page.

the problem is this, when it goes back 2 in history, it skips over
that report page, and goes to the page that I clicked report on. if i
set it to -1, it goes back to the login page. so it is missing the
page that redirected it to begin with.

am i doing something wrong?


I prefer serverside session memory over clienside history:

if session("logged in") <> 1 then
session("origin ") = request.serverv ariables("URL")
response.redire ct "login.asp"
end if

And a successful login will do:

response.redire ct session("origin ")

===========

Another way is to build the login code
as an include to every page top:
========= login.include.a sp =============
<%
if request.form("p assword") <> "" then
do your autentication things
and set session("logged in") to 1 if ok.
end if

if session("logged in") <> 1 then
%>
<html>
<form method=post>
do the login html form things
....
</html>
<%
response.end
end if
%>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 19 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
7372
by: Ashot | last post by:
This is sort of both Python and Vim related (which is why I've posted to both newsgroups). Python related: ---------------------- I have been frustrated for quite some time with a lack of a history command in IDLE (in fact with IDLE in general). Often I'll develop new code at the command line, testing each line as I go. Currently I have...
12
3357
by: |-|erc | last post by:
when a user clicks back to get to my site, I want it to run a javascript function. can you detect when the FORWARD button is greyed out? Herc -- I call3d this fugly and I'm proud www.supernerd.com.au/~gray77/kath1.jpg
10
8053
by: pmelanso | last post by:
Hello, How can I tell if there is a page to go back to in the history or not??? Same with forward??? say something like/// if (there is a page to go back to ) { // DO something }else { }
3
10459
by: Phil Sherman | last post by:
UDB LUW (Windows) 8.1 FP9a I issued a PRUNE HISTORY 20050819 AND DELETE and was surprised to see that the archived log files were not physically deleted. The history record of the 20050818 backup was correctly deleted from the history file. I then issued a PRUNE LOGFILE PRIOR TO Snnnnnnn.LOG command which did delete the logs. Both commands...
20
3609
by: Dan | last post by:
Is there a way to obtain the last page visited? I don't want to go to that page, I just want to be able find out what page they came from, the url of that page. Is this possible?
3
3861
by: pentisia | last post by:
Hi there, We are using history.go(integer) to go back to the certain page directly. Because there are some pages interaction in between. For example, starting from page 1 to page 2. From page 2, it will reload sometime, or go to page 3 and then go back to page 2 again. If we use history.back, it will only go back to the previous page. ...
3
2236
by: Niall | last post by:
When I say 'last', I mean (eg.) the 100th item in a 100-item history list, *not* the immediately previous one! The problem is, the history.go() method only allows *relative* movement through the history list. I need to go directly to the end -- an *absolute* movement -- and there doesn't appear to be any way of finding out the number of...
10
10402
Ajm113
by: Ajm113 | last post by:
Making a History Page for BIG Sites Intro: Ok, let's say after a while your website has grown massive. We're talking search engine, forum and video hosting -- you've got a LOT of content. And you are wondering, "Why do I need yet another feature for my big site?" Well, some people can become forgetful every time they see content on your...
0
1528
by: lemnitzer | last post by:
Full Article: http://iamthewitness.com/FreedmanFactsAreFacts.html <-------- KEY DOCUMENT Steamy Excerpts: Will you be patient with me while I review here as briefly as I can the history of that political emergence and disappearance of a nation from the pages of history?
2
3308
by: Max | last post by:
I recently moved to ASPnet Ext 3.5 What I can't get with Ajax and History browser managemet is this: User fills some fields (dropdown and textbox) on page 1 (all are in an update panel) User clicks Submit Button I write the data into a DB I add a history point with ScriptManager to be able to get back to this point with browser back...
0
7687
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7777
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6413
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5585
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5290
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3731
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2203
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1300
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.