473,749 Members | 2,402 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to refer to Root on Transfer

Hi ,

I have a few folders within my root directory on my web server where
different app components live. One folder, "Reports", is where all the ASPX
pages live that have reports embedded in them (Crystal). However, we also
have very fine-grained application security that we implement. When a
security violation is encountered, we send them to a common security
violation page. My problem is that I have a common component that does the
checking and the actually transferring to the security violation page. When
I do this:

Server.Transfer ("SecurityViola tion.aspx")

It works if that page calling the security component is at the root level.
However, if do the same thing from an ASPX page within the "Reports" folder,
it can't find the Security page. Reason being it is a page nested within
Reports and SecurityViolati on.ASPX lives at the Root level.

My question is, how does one specify to always look in the Root directory
with the Transfer method. I don't want to have to do something like:

Server.Transfer ("..\SecurityVi olation.aspx") if I am in the Reports folder
and without the "..\" when at the root.

Hardcoding the path like this works for those ASPX pages in the Reports
folder...but not what I want to do.

Thanks...Paul

Nov 17 '05 #1
3 4341
Try using the tilde.
Something like this:
Server.Transfer ("~/SecurityViolati on.aspx")

Here's more info:
http://authors.aspalliance.com/remas...eatures/Tilde/

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"paul reed" <pr****@jackson reed.com> wrote in message
news:eL******** ******@TK2MSFTN GP11.phx.gbl...
Hi ,

I have a few folders within my root directory on my web server where
different app components live. One folder, "Reports", is where all the ASPX pages live that have reports embedded in them (Crystal). However, we also
have very fine-grained application security that we implement. When a
security violation is encountered, we send them to a common security
violation page. My problem is that I have a common component that does the
checking and the actually transferring to the security violation page. When I do this:

Server.Transfer ("SecurityViola tion.aspx")

It works if that page calling the security component is at the root level.
However, if do the same thing from an ASPX page within the "Reports" folder, it can't find the Security page. Reason being it is a page nested within
Reports and SecurityViolati on.ASPX lives at the Root level.

My question is, how does one specify to always look in the Root directory
with the Transfer method. I don't want to have to do something like:

Server.Transfer ("..\SecurityVi olation.aspx") if I am in the Reports folder
and without the "..\" when at the root.

Hardcoding the path like this works for those ASPX pages in the Reports
folder...but not what I want to do.

Thanks...Paul

Nov 17 '05 #2
Steve,

You are the man!!! Thanks so much...that did the trick.

Paul

"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:eh******** ******@TK2MSFTN GP10.phx.gbl...
Try using the tilde.
Something like this:
Server.Transfer ("~/SecurityViolati on.aspx")

Here's more info:
http://authors.aspalliance.com/remas...eatures/Tilde/

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"paul reed" <pr****@jackson reed.com> wrote in message
news:eL******** ******@TK2MSFTN GP11.phx.gbl...
Hi ,

I have a few folders within my root directory on my web server where
different app components live. One folder, "Reports", is where all the

ASPX
pages live that have reports embedded in them (Crystal). However, we also have very fine-grained application security that we implement. When a
security violation is encountered, we send them to a common security
violation page. My problem is that I have a common component that does the checking and the actually transferring to the security violation page.

When
I do this:

Server.Transfer ("SecurityViola tion.aspx")

It works if that page calling the security component is at the root level. However, if do the same thing from an ASPX page within the "Reports"

folder,
it can't find the Security page. Reason being it is a page nested within
Reports and SecurityViolati on.ASPX lives at the Root level.

My question is, how does one specify to always look in the Root directory with the Transfer method. I don't want to have to do something like:

Server.Transfer ("..\SecurityVi olation.aspx") if I am in the Reports folder and without the "..\" when at the root.

Hardcoding the path like this works for those ASPX pages in the Reports
folder...but not what I want to do.

Thanks...Paul


Nov 17 '05 #3
Hi Paul,

The Server.Transfer terminates execution of the current page and begins
execution of a new page using the specified URL path to the page.

If the new page is in the current directory, we can use the page name
directly.

Server.Transfer ("Simple.asp x")

If the new page is not in the current directory, we need to specify the
opposite path or the absolute path. As I understand, what you want is using
the absolute directory. It works whether the new page is in the current
directory or not.

Server.Transfer ("/App1/Simple.aspx")

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #4

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

Similar topics

2
4453
by: Mike | last post by:
I've been trying to setup Dean Allen's excellent "Refer" script. (http://www.textism.com/tools/refer/) The instructions say to add this code to the bottom of whatever web pages you want the refer script to track (after the closing </html> tag): <?php include '<?php echo dirname($_SERVER) ?>/refer.php' ?> Doing so results in the following error on any pages that have the
3
1550
by: Tor Inge Rislaa | last post by:
How to refer to a variable on another webform Hi, I have a Webform1 with a public variable that is assigned a value before my Webform2 is displayed. In the Page_Load procedure of Webform2 I want to evaluate the value of the variable of Webform1. Code on Webform1 Public MyVar1 As Integer
1
1391
by: Dave | last post by:
Sorry, another quick question, How can I refer to the root of my web application? Say I have an image in my root folder that I want to use in a subfolder of a subfolder of the web application. Do I need to know how many directory levels deep I am to reference it?
1
1425
by: ad | last post by:
I place a Loading.aspx in the Util folder of my project, Util folder in in the root directory. I refer Loading.aspx in this way: ~/Util/Loading.aspx in Javascript, But it fail to find Loading.aspx in run time. How can I refer Loading.aspx in Javascript? Below in the actual code: ---------------------------------------------------------------------------- ---------------------------------------- JavaScript += "function...
9
6651
by: MR | last post by:
I get the following Exception "The data at the root level is invalid. Line 1, position 642" whenever I try to deserialize an incoming SOAP message. The incoming message is formed well and its length is 642 bytes ( I have appended it to the end of this message). I suspect that the reason may have something to do with an incorrect declaration of which class to de-serialize to. In the attached code I substituted @@@@@@@ in the code below with...
10
2365
by: p3t3r | last post by:
I have a treeview sourced from a SiteMap. I want to use 2 different CSS styles for the root level nodes. The topmost root node should not have a top border, all the other root nodes should have a top border. Is it possible to have more than 1 style at the same level (parent node) when using a SiteMap? I want it to appear something like this and I can only find a way to either have the border on all root nodes or none at all. In...
2
1119
by: cisco | last post by:
My main site is in .NET 2.0 but i have one virtual directory under this that i want to run under 1.1. When i change the mode to 1.1 and try to browse to it it seems to pull in the root's web.config file(which is in 2.0). {root_in_2.0}\web.config {root_in_2.0}\{vdir_in_1.1}\web.config I should say they are different app pools. Appreciate it,
2
28980
by: somaskarthic | last post by:
Hi In my php page my i'm displaying a image. The image resides in the same location where the php page resides. when i refer other image src other than in the document root , it is not working. /var/www/html is the document root. My php page and the image resides in var/www/html folder. I could access it as http://localhost/mypage.php. It displays the image and working fine. If i refer it from some other folder like /var/imagefolder/,...
2
12912
by: Rick | last post by:
First of all, is there a group more specific to WPF? I have a WPF form and I want to bind to a local member variable from the xaml. the code behind is like this: Partial Public Class MyClass Public Property MyProp as system.xml.XmlDocument get...
0
9566
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
9388
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
9333
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,...
1
6800
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
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
4608
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
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.