Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Authenticating Correct Login

Status
Not open for further replies.

isthisthingon

IS-IT--Management
May 17, 2005
65
US
I know someone here will have the solution to my problem. I have created some ASP pages that all work fine. I have included code that will make sure the user is logged in to prevent users from typing in the direct url adn bypassing the login.

The code on the top of all my working as pages are working just fine:

<%@ Language=VBScript %>

<%Response.Expires = -1 %>
<%Response.ExpiresAbsolute = Now() - 1 %>
<%Response.AddHeader "pragma", "no-cache" %>
<%Response.AddHeader "cache-control", "private" %>
<%Response.CacheControl = "no-cache" %>

<%
Response.Expires = -1000
Response.Buffer = True
Response.Clear
%>

<!--#include file="logincheck.asp"-->

<html>
<head>
<title>Welcome To Our Site :: <%=Your_UserName%></title>
<meta http-equiv="Content-Language" content="en-us">
etc ......

This code on my newly created page does not work. Please help:

<<%@ Page Language="VB" %>
<%@ Import Namespace="System.IO" %>

<script language="VB" runat="server">

Sub Page_Load(sender as Object, e as EventArgs)
Dim strPath As String = "./uploads/"
Dim myDirInfo As DirectoryInfo

lblPath.Text = strPath

Dim strCompletePath As String
strCompletePath = Server.MapPath(strPath)
myDirInfo = New DirectoryInfo(strCompletePath)

dgFileList.DataSource = myDirInfo.GetFiles()
dgFileList.DataBind()
End Sub

</script>

<!--#include file="logincheck.asp"-->

<html>
<head>
etc.....
 
When you say it is not working, are you receiving an error message or in what way is it not working?

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
it returns the following error screen:

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
 
Is this an ASP.NET application? If so, you might try forum855

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top