473,779 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple Question regarding relative path references

Hi all,

I hope that this question isn't too simple...

I am storing all of my webforms in a /forms directory (with the
exception of Default.aspx). I have created the following code in
Global.asax which is supposed to forward people to the login page if
they make a request (for any page) without an active session.

Sub Session_Start(B yVal sender As Object, ByVal e As EventArgs)
If InStr(Request.P ath.ToLower, "login.aspx ") = 0 Then
Response.Redire ct("forms/login.aspx")
End If
End Sub

The problem is, It appears to be adding the url to the end of the
current path. So, if they were in a form in the forms directory which
has 'expired', the redirection is attempted againts

http://localhost/myapp/forms/forms/login.aspx

I've tried "./../forms/logix.aspx" however to no avail... because files
are not 'always' called from the forms directory (eg, default.aspx)

Can someone please point out to me what I'm doing wrong?
Thanks in advance,

Damien Sawyer

Nov 19 '05 #1
1 1017
Have you tried:

Sub Session_Start(B yVal sender As Object, ByVal e As EventArgs)
If InStr(Request.P ath.ToLower, "login.aspx ") = 0 Then
Response.Redire ct("~/forms/login.aspx")
End If
End Sub

However you should check out:
http://msdn.microsoft.com/library/en...entication.asp
and
http://msdn.microsoft.com/library/en...onprovider.asp
as Form authentication is already provided for you.

Nov 19 '05 #2

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

Similar topics

15
2909
by: Nick K. | last post by:
I recently began maintenance work on a production web server that is located in the root directory of a web server. I moved this into a sub web on my local web server in order to do work on it. I found that there is an include file that references images: <img src = "/images/Header.gif" What worked correctly on the production server breaks on mine because of the absolute address "/images". I removed the absolute address and changed...
24
4497
by: sinister | last post by:
After doing a websearch, it appears that it's OK to omit the "http:" to form a relative URL. Are there any pitfalls to this? For example, if there is a page http://www.domain1.com/page1.html with a link to http://www.domain2.com/page2.html you can abbreviate the second link as //www.domain2.com/page2.html
2
1839
by: ians0131 | last post by:
I have a problem with setting references between library databases when I move them to a different location. I thought that as long as the relative path remained constant, the references would remain intact, but this doesn't seem to be the case. I have this sort of structure, with several Library databases in each subdirectory: DBDir+---LibSubDir1 |
1
3313
by: Alex VanderWoude | last post by:
I am trying to <include> some text into an XML documentation topic, but that text is stored in a file that is in a different directory than the "current" XML file. Using a relative path does not appear to work, because the base being used is the Common7\IDE directory, not my original source directory. Here is the situation: MyApp directory contains the file Form1.cs, Form1.xml, and Generic.xml. There is also a subdirectory called...
4
27729
by: Richard | last post by:
We are distributing a VS2003 solution to our customers that includes a .NET assembly (dll file) and a sample project for how to use the dll. The customer can then customize the sample or add a new project to the solution. The problem is that the customers cannot simply take the solution we distribute and build it. VS2003 is saving the reference to the dll as an fully qualified absolute path (not relative to the project), so after...
0
1305
by: Jason Lawrence | last post by:
I have an attributed ATL project (call it B) that I am building with Microsoft Visual C++ .NET (55537-640-3684941- 18356). In the project I include the COM generated file A.h (from another ATL project A). The compiler interprets this and injects the command "import A.idl" into the idl for B. So far everything is okay. The problem is that when I build project B in debug, it references A.idl using the absolute path. When I build...
19
2989
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and provide an open TD with a DIV in it for the content of this formlet. (The DIV is for DHTML to hide and show the content) I've created a web page showing step by step the two problems I'm encountering. This problem is much easier to see than it...
18
9447
by: Nak | last post by:
Hi there, Does anyone know what path the AssemblyKeyFile attribute is relative to? For example I currently have mine set to <Assembly: AssemblyKeyFile("..\NicksKey.snk")> Sometimes this works, and sometimes I need to change it to <Assembly: AssemblyKeyFile("..\..\NicksKey.snk")>
1
1887
by: ax | last post by:
Dear Experts, I really worry about the following problem.. There is one XML File on my PC located at C:\Test. Hence, there are 2 XSD files on the same path I make an absolut reference in the XML file to the 2 XSD files. xmlns:address="C:\Test\file_address.xsd"
0
9632
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10302
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10136
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10071
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
6723
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5372
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5501
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.