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!

Include Statement Causing Problems

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.....
 
Includes are problematic with ASP.NET. Create a user control, and put it on your page.
 
also, setting your forms authentication web.config to Protection=All prevents url typing and redirects to the login page specified
 
please pardon my newbie status, how do I create a user control? also, if I set protection=all, do i even need to use the logincheck.asp page to prevent users from typing the url directly? Thanks!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top