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

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("SecurityViolation.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 SecurityViolation.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("..\SecurityViolation.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 4304
Try using the tilde.
Something like this:
Server.Transfer("~/SecurityViolation.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****@jacksonreed.com> wrote in message
news:eL**************@TK2MSFTNGP11.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("SecurityViolation.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 SecurityViolation.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("..\SecurityViolation.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.net> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl...
Try using the tilde.
Something like this:
Server.Transfer("~/SecurityViolation.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****@jacksonreed.com> wrote in message
news:eL**************@TK2MSFTNGP11.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("SecurityViolation.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 SecurityViolation.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("..\SecurityViolation.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.aspx")

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
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...
3
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...
1
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....
1
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...
9
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...
10
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...
2
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...
2
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....
2
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.