473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

best way to redirect asp to login htm page?

Hello,

I need users to access a data entry asp page via a login
page. If they bookmark the data entry asp I want to
redirect them to the login page (using IIS). Here is what
I had in mind:

<%@ LANGUAGE=JScript %>
<HTML>
<HEAD>
<TITLE>Home Page</TITLE>
<script language="JavaScript">
function myFunction(s){
....
location.href='insert.htm';}
</SCRIPT>
</HEAD>
<body onLoad="myFunction('<%Response.write(Request.Form
("testfld"));%>')">
....

Isn't there some kind of authentication method for IIS, or
at least a less kludgy way of doing this than what I have
above? Just checking.

Thanks,
Rich
Jul 19 '05 #1
6 5682
have the login place a cookie/session variable...check for it...if it's not
there redirect

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------
"Rich" <rp*****@aol.com> wrote in message
news:4e****************************@phx.gbl...
Hello,

I need users to access a data entry asp page via a login
page. If they bookmark the data entry asp I want to
redirect them to the login page (using IIS). Here is what
I had in mind:

<%@ LANGUAGE=JScript %>
<HTML>
<HEAD>
<TITLE>Home Page</TITLE>
<script language="JavaScript">
function myFunction(s){
...
location.href='insert.htm';}
</SCRIPT>
</HEAD>
<body onLoad="myFunction('<%Response.write(Request.Form
("testfld"));%>')">
...

Isn't there some kind of authentication method for IIS, or
at least a less kludgy way of doing this than what I have
above? Just checking.

Thanks,
Rich

Jul 19 '05 #2
Thank you for your reply. This sounds logical. May I
request one more thing? I took a course in javascript
which used some asp examples a few years ago (didn't work
with it since then). Now I am back at it for real. We
did infact work with cookies, but I only vaguely remember
how to set/read them. Would have any sample syntax or
point me where I could see some examples? JS/vbs either
or.

Thanks again for your reply.

Rich

-----Original Message-----
have the login place a cookie/session variable...check for it...if it's notthere redirect

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------
"Rich" <rp*****@aol.com> wrote in message
news:4e****************************@phx.gbl...
Hello,

I need users to access a data entry asp page via a login
page. If they bookmark the data entry asp I want to
redirect them to the login page (using IIS). Here is what I had in mind:

<%@ LANGUAGE=JScript %>
<HTML>
<HEAD>
<TITLE>Home Page</TITLE>
<script language="JavaScript">
function myFunction(s){
...
location.href='insert.htm';}
</SCRIPT>
</HEAD>
<body onLoad="myFunction('<%Response.write(Request.Form
("testfld"));%>')">
...

Isn't there some kind of authentication method for IIS, or at least a less kludgy way of doing this than what I have above? Just checking.

Thanks,
Rich

.

Jul 19 '05 #3
VBScript

string = Request.Cookies("name")
Response.Cookies("name") = string
--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------
"Rich" <rp*****@aol.com> wrote in message
news:4f****************************@phx.gbl...
Thank you for your reply. This sounds logical. May I
request one more thing? I took a course in javascript
which used some asp examples a few years ago (didn't work
with it since then). Now I am back at it for real. We
did infact work with cookies, but I only vaguely remember
how to set/read them. Would have any sample syntax or
point me where I could see some examples? JS/vbs either
or.

Thanks again for your reply.

Rich

-----Original Message-----
have the login place a cookie/session variable...check

for it...if it's not
there redirect

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------
"Rich" <rp*****@aol.com> wrote in message
news:4e****************************@phx.gbl...
Hello,

I need users to access a data entry asp page via a login
page. If they bookmark the data entry asp I want to
redirect them to the login page (using IIS). Here is what I had in mind:

<%@ LANGUAGE=JScript %>
<HTML>
<HEAD>
<TITLE>Home Page</TITLE>
<script language="JavaScript">
function myFunction(s){
...
location.href='insert.htm';}
</SCRIPT>
</HEAD>
<body onLoad="myFunction('<%Response.write(Request.Form
("testfld"));%>')">
...

Isn't there some kind of authentication method for IIS, or at least a less kludgy way of doing this than what I have above? Just checking.

Thanks,
Rich

.

Jul 19 '05 #4
Hey rich, does your login page submit straight to the data entry page?

If so then at the start of the data entry page you could just check that one
of the fields from your login page actually has data in it, and if it
doesn't then redirect the user back there.

so put this at thge start of your data entry page..

<%
if request.form("yourformfield")="" then

response.write "<script>alert('you must come here from the login
page.')</script>";
response.redirect "login.htm"

else
'show the data entry page
end if

%>

hoope this helps

dave

"Rich" <rp*****@aol.com> wrote in message
news:4e****************************@phx.gbl...
Hello,

I need users to access a data entry asp page via a login
page. If they bookmark the data entry asp I want to
redirect them to the login page (using IIS). Here is what
I had in mind:

<%@ LANGUAGE=JScript %>
<HTML>
<HEAD>
<TITLE>Home Page</TITLE>
<script language="JavaScript">
function myFunction(s){
...
location.href='insert.htm';}
</SCRIPT>
</HEAD>
<body onLoad="myFunction('<%Response.write(Request.Form
("testfld"));%>')">
...

Isn't there some kind of authentication method for IIS, or
at least a less kludgy way of doing this than what I have
above? Just checking.

Thanks,
Rich

Jul 19 '05 #5
Thank you all for your responses. This really helps me
out. I actually know how to do this stuff in JSP, but I
don't want to use Tomcat because I am all hooked up with
IIS/SqlServer now. My vbscripting is weak, at best. Oh
well. I will be hanging around here a lot :).

Thanks again,
Rich
-----Original Message-----
Hello,

I need users to access a data entry asp page via a login
page. If they bookmark the data entry asp I want to
redirect them to the login page (using IIS). Here is whatI had in mind:

<%@ LANGUAGE=JScript %>
<HTML>
<HEAD>
<TITLE>Home Page</TITLE>
<script language="JavaScript">
function myFunction(s){
....
location.href='insert.htm';}
</SCRIPT>
</HEAD>
<body onLoad="myFunction('<%Response.write(Request.Form
("testfld"));%>')">
....

Isn't there some kind of authentication method for IIS, orat least a less kludgy way of doing this than what I have
above? Just checking.

Thanks,
Rich
.

Jul 19 '05 #6
Rich, how about this? A friend of mine found this (or invented it).
Put it in your global.asa file in the Session_OnStart routine.

' If someone initially tries to load any page other than the
' start page, redirect them.
' NOTE - If the redirect happens, the rest of this function
' is not executed, so be sure this is LAST!

Session("requestedPage") = Request.ServerVariables("SCRIPT_NAME")
if not (STRCOMP(Application("StartPage"), Session("requestedPage"),
vbTextCompare)=0) then
Response.Redirect Application("StartPage")
end if

Works for me. No cookies (other than ASP's own). Just set
Application("StartPage") to "login.asp" (or whatever you're using) in
your Application_OnStart routine.

Tom

On Tue, 9 Sep 2003 07:52:56 -0700, "Rich" <rp*****@aol.com> wrote:
Thank you all for your responses. This really helps me
out. I actually know how to do this stuff in JSP, but I
don't want to use Tomcat because I am all hooked up with
IIS/SqlServer now. My vbscripting is weak, at best. Oh
well. I will be hanging around here a lot :).

Thanks again,
Rich
-----Original Message-----
Hello,

I need users to access a data entry asp page via a login
page. If they bookmark the data entry asp I want to
redirect them to the login page (using IIS). Here is

what
I had in mind:

<%@ LANGUAGE=JScript %>
<HTML>
<HEAD>
<TITLE>Home Page</TITLE>
<script language="JavaScript">
function myFunction(s){
....
location.href='insert.htm';}
</SCRIPT>
</HEAD>
<body onLoad="myFunction('<%Response.write(Request.Form
("testfld"));%>')">
....

Isn't there some kind of authentication method for IIS,

or
at least a less kludgy way of doing this than what I have
above? Just checking.

Thanks,
Rich
.


Jul 19 '05 #7

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

Similar topics

5
by: Simon | last post by:
Hi, I have a Login.php page that logs the user in and out. I has two forms within the page, (depending on what we are trying to do), either one to log in or out. The form calls itself using a...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
1
by: Sospeter | last post by:
Hi Ken, I have done that but still experiencing same problem. Tried the following i.e. turning smartnavigation = false and using server.transfer as below but nothing works. Please help. ...
10
by: GreggTB | last post by:
I've got an page (LOGIN.ASPX) that receives the user's login information. During the page load, it checks the credentials against a database and, if validation is successful, creates an instance of...
3
by: William Sullivan | last post by:
Have a frameset HTML page (parent) with child .aspx pages. When each of the child pages loads, it checks to see if the user is authenticated, and if not, redirects to the login page: ...
7
by: savvy | last post by:
I able to redirect the user to the index.aspx page after every successful login, but I dont want certain pages outside the folder to have a access to general public. So if they click that...
5
by: rockdale | last post by:
Hi, all: I have a website with its own login page. Now one of my clients want their employees log into my website from their website. They want to have their login page (look and feel are...
0
by: daonho | last post by:
Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As System.EventArgs) Dim strPath As String = HttpContext.Current.Request.Path() Dim cookie As...
3
by: jasonheath.net | last post by:
I apologize in advance for the length of this post. I wanted to get as much detail as possible in here. We have 1 web app that contains the functionality to do some single sign-on logic. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...
0
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...

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.