473,385 Members | 2,013 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,385 software developers and data experts.

Asp page authentication

My thanks to Nathan for the code below, but it does not work. I get the
following error;

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/dev/development/WAN RCI Secure/DumpSearch.asp, line 700
Function AuthCheckT

How can I get this to work?

Cheers, Bill.


Use some Javascript code to check the window.opener value. If it is
null, the window was navigated directly to. If it is not null, it will
contain a reference to the window that opened it - you code would look
something like:

<script language=javascript>

function doLogin() {
if (window.opener == null) {
document.location.href = "default.asp?status=timeout";
}
else {
window.opener.document.location.href =
"default.asp?status=timeout";
window.close();
}
}

<%
Function AuthCheck()
If IsEmpty(Session("UID")) then
Response.Write "doLogin();"
End If
End Function
%>

</script>

The ASP code MUST be inside the script block - the JScript function
will always be on the page, but only when the ASP checks the session
and finds nothing there is the call to the function written up to the
browser. I didn't actually test the Javascript, so it might not be
100% accurate, but you should be able to get the idea.
"William E Hatto" <xx***********@bigpond.net.au> wrote in message
news:<e9*************@TK2MSFTNGP10.phx.gbl>...
Hi 1 and all,

I have an asp application/web site that uses a logon page then a page for
the menus and separate asp pages for all the options in the menus.

The options listed in the menu's spawn separate web windows leaving the menu page in the background.

Common to all of these pages I am using authentication. The authentication
function is as follows;

Function AuthCheck()
If IsEmpty(Session("UID")) then
Response.Redirect "default.asp?status=timeout"
Response.End
End If
End Function

My problem is when authentication is called on a spawned page it takes the
spawned page back to logon. What I want to happen is the spawned page to
close and the menu page return to the logon page.

In the event a page is called without logging on and using the menus I would like the page to revert back to the logon page.

I understand it may require some 'fancy' javascript. I am using some
javascript in my pages, but having only dabelled in it I am unable to use it to the degree it may be required above.

Can this be done, if so how?
Many thanks, Bill.

Jul 19 '05 #1
1 2353
"William E Hatto" <xx***********@bigpond.net.au> wrote in message
news:eF**************@TK2MSFTNGP09.phx.gbl...
My thanks to Nathan for the code below, but it does not work. I get the
following error;

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/dev/development/WAN RCI Secure/DumpSearch.asp, line 700
Function AuthCheckT

How can I get this to work?

<%
Function AuthCheck()


Try removing the "()" after the function name.

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #2

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

Similar topics

1
by: William E Hatto | last post by:
Hi 1 and all, I have an asp application/web site that uses a logon page then a page for the menus and separate asp pages for all the options in the menus. The options listed in the menu's...
2
by: Senthil | last post by:
1. Created a new C# web application project 2. Change the name of webform1 to login.aspx 3. And in the .cs file change the name of the class to login, and include System.web.security namespace....
23
by: Lamberti Fabrizio | last post by:
Hi all, I've to access to a network file from an asp pages. I've red a lot of things on old posts and on Microsoft article but I can't still solve my problem. I've got two server inside the...
1
by: Stu | last post by:
Hi All, I have an ASP.NET application to which I have implemented forms authentication to handle security. It is a relatively straight forward solution with all aspx pages residing in the root...
1
by: Grey | last post by:
I have set the following parameters in web.config to prevent user direct access the web page without user login. <authentication mode="Forms"> <forms loginUrl="Initial/index.aspx"...
4
by: SB | last post by:
Hi I'm trying to get forms-based authentication to authenticate different users for differet pages, like this: <configuration> <location path="Member" allowOverride="true"> <system.web>...
8
by: Edward Mitchell | last post by:
I have a main project that is protected in that the user is directed to a login.aspx file. The text in the web.config file is: <authentication mode="Forms"> <forms loginUrl="Login.aspx" />...
4
by: js | last post by:
I am building a intranet site that has public and private information that are rendered by ASP.Net pages. The site is not partitioned into private/public folders. When users hit the site's URL,...
7
by: Alan Silver | last post by:
Hello, Sorry this is a bit wordy, but it's a pretty simple question... I have a web site, http://domain/ which is a public site, part of which (http://domain/a/) is protected by forms...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.