"Cannot use a leading .. to exit above the top directory."

I have a weird problem with a site that doesn't face issues in development using Cassini, but crashes hard when deployed to an IIS 6.0. Windows 2003 server.

Basically, I'm using a rewriting engine and everything goes fine if, say, I have a URL like this:

www.site.com/products.list

...but when I append a page number to the end like this:

www.site.com/products.list/2

ASP.NET blows up and gives me this the error at the bottom of the post.

I know there are some issues with URL rewriting in ASP.NET 2.0 as described here:

http://todotnet.com/archive/0001/01/01/7472.aspx?Pending=true

But this actually doesn't apply to me. I'm seeing the error when browsing to the site with internet explorer!

Is there something wrong with using numbers at the end of a URL with IIS 6.0?

Again here's the error info:

Server Error in '/' Application.

Cannot use a leading .. to exit above the top directory.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Cannot use a leading .. to exit above the top directory.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]
   System.Web.Util.UrlPath.ReduceVirtualPath(String path) +3527366
   System.Web.Util.UrlPath.Reduce(String path) +84
   System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative) +355
   System.Web.HttpResponse.ApplyAppPathModifier(String virtualPath) +208
   System.Web.UI.WebControls.SiteMapPath.InitializeItem(SiteMapNodeItem item) +761
   System.Web.UI.WebControls.SiteMapPath.CreateItem(Int32 itemIndex, SiteMapNodeItemType itemType, SiteMapNode node) +111
   System.Web.UI.WebControls.SiteMapPath.CreateControlHierarchyRecursive(Int32& index, SiteMapNode node, Int32 parentLevels) +88
   System.Web.UI.WebControls.SiteMapPath.CreateControlHierarchy() +93
   System.Web.UI.WebControls.SiteMapPath.CreateChildControls() +29
   System.Web.UI.Control.EnsureChildControls() +87
   System.Web.UI.Control.PreRenderRecursiveInternal() +41
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

 

 

0
BoulderBum
8/22/2006 10:19:36 PM
asp.net.web-hosting 912 articles. 0 followers. Follow

40 Replies
4092 Views

Similar Articles

[PageSpeed] 0

What is the actual rewrittent URL?  What do the IIS logs show for the request?

Jeff


Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
0
jeff
8/24/2006 8:43:59 PM

The actual rewritten url for a URL like: www.site.com/products.list/2 would be: www.site.com/list.aspx?type=products&page=2.

Looking at the event logs for the server, I can see an application warning providing much of the same exception information as above and noting that the URL is (paraphrased) www.site.com/list.aspx?type=products&page=2 with a request path of: /list.aspx.

I suppose it's logical that somehow, something that ASP.NET rewrites is referencing a resource like ../../resource but first: I don't know why it would be doing that as I override the form to remove the action and I don't use any ResolveUrl() functions and second: it works perfectly with the Cassini server on Windows XP Pro!

0
BoulderBum
8/24/2006 10:07:59 PM

hi ,

i get the same message .i checked the entire code , i dont have the .. reference to anywhere in the code .

Is there any other reason why this does not work ? .I have tried everything including the settings of the IIS , searching the code , etc ... ALso cannot find a solution in any newsgroups on the net.

 

Cannot use a leading .. to exit above the top directory.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Cannot use a leading .. to exit above the top directory.

Source Error:

 
[No relevant source lines]


1
anpat
10/17/2006 2:47:32 AM

I actually fixed my problem. I can't remember exactly what the solution was (I'll try to double-check).

 I think it ended up being that I had a .CSS file in a theme directory which got automatically added to the Page. It didn't jive with the URL rewriting, unfortunately.

0
BoulderBum
10/17/2006 4:09:14 AM

I confirmed my suspicions. My problem was the way ASP.NET resolved the URL of the CSS file in the Theme directory. I simply moved the CSS file elsewhere so it wouldn't be automatically referenced (in the wrong way) and everything was fine.

I also recall that I could examine the HTML output of the page in the development environment and it had the defective reference, though it didn't manifest itself as a server-crasher until I moved the app to a Win 2k3 machine (in my case, there was a secondary mechanism of referencing the CSS file so I was none-the-wiser for a while). My point is that if you have a local develpment copy of the app, examine the problem Page and it should give you a clue about what's going wrong.

0
BoulderBum
10/17/2006 9:21:23 PM

I tried changing the .css file from the themes folder ,but still the same error exists, only for my aspx pages.I have some asp pages also in the same site,and all of them work,none of the aspx pages work with this error .

 

Could there be any other reason ? I tried everything mentioned in all newsgroups , but none worked..

 Please HELP !!!!

0
anpat
10/20/2006 12:58:35 AM
Did you examine the HTML produced by the problem pages in your development environment (i.e. on an XP machine)?
0
BoulderBum
10/20/2006 2:47:06 AM

Yes... Thanks , I could identify the problem line from the HTML produced by  the problem pages . It was traced to a line in the global.asax . I corrected it and it works now.

 Thanks again for the help.........

0
anpat
10/22/2006 3:56:52 AM
No problem.
0
BoulderBum
10/23/2006 2:21:36 AM

 We got same problem.at that time we deleted one "webinfo" file from application .then it is working fine.

0
san
10/1/2007 6:41:22 AM

Hi All,

I found another situation in which this could occur...

 Using Server.Transfer instead of Response.Redirect...

 What I have is a Custom Control called "HtmlControl" which looks for the querystring of the content to show, if not found I redirect the response to the Sitemap with a message that the page is not found. I place a control onto a page "mypage.aspx". When the query string is not found my request was sent to a sitemap but after the page_PreRender my page errors out with the following message:

  "Cannot use a leading .. to exit above the top directory"

The interesting thing is that the response was sent back to mypage.aspx and that's the page which is shown on the error log. So I was trying all the style things described in your post and lots of other, then it hit me that it only started happening after I moved the functionality from UserControl (within the website) to the library as a Custom Control. That's when the errors started happening.

I think it happens because Server.Transfer is still using the previous page and Response.Redirect doesn't.

This is not the first issue I had with Server.Transfer where I had to rewrite some code... you can probably find some of the posts where I described/solved the similar issue same way.

Thank you for the post anyway cause it gave me some ideas of how to resolve the favicon on my master page...

 Tatyana Hughes


Thank you,
Tatyana Hughes
0
AspForumTanya
11/14/2007 5:18:15 PM

did u guys enable parent path on iis directory configuration ?

 

I think there needs to be a clearer error message for this kind of mistake ?


Satılık,Kiralık emlak ilanlari
-1
erdsah88
12/17/2007 6:58:00 AM

I'm not sure what do you mean by "enable parent path on iis dir config"  but there is a post I added regarding my issue. Since I changed the redirect I didn't have any issues:

http://forums.asp.net/p/1182074/2006352.aspx#2006352

 

If you have a better solution please explain better I'll gladly switch from Response.Redirect to Server.Transfer

Thanks,

Tatyana


Thank you,
Tatyana Hughes
0
AspForumTanya
12/17/2007 2:44:50 PM

This is the error I am getting:

 Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 12/23/2007 10:36:00 PM
Event time (UTC): 12/24/2007 3:36:00 AM
Event ID: 35801b7140f14040b14138208ef5e7d1
Event sequence: 540
Event occurrence: 18
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/1853235269/Root-1-128429392640001030
    Trust level: Full
    Application Virtual Path: /
    Application Path: C:\Inetpub\wwwroot\zikbay_new.com\
    Machine name: H145104
 
Process information:
    Process ID: 159884
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE
 
Exception information:
    Exception type: HttpException
    Exception message: Cannot use a leading .. to exit above the top directory.
 
Request information:
    Request URL: http://as247gera.zikbay.com/ShowAd.aspx?id=3274
    Request path: /ShowAd.aspx
    User host address: 66.249.66.168
    User:  
    Is authenticated: False
    Authentication Type:  
    Thread account name: NT AUTHORITY\NETWORK SERVICE
 
Thread information:
    Thread ID: 1
    Thread account name: NT AUTHORITY\NETWORK SERVICE
    Is impersonating: False
    Stack trace:    at System.Web.Util.UrlPath.ReduceVirtualPath(String path)
   at System.Web.Util.UrlPath.Reduce(String path)
   at System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative)
   at System.Web.HttpResponse.ApplyAppPathModifier(String virtualPath)
   at System.Web.UI.HtmlControls.HtmlForm.GetActionAttribute()
   at System.Web.UI.HtmlControls.HtmlForm.RenderAttributes(HtmlTextWriter writer)
   at System.Web.UI.HtmlControls.HtmlControl.RenderBeginTag(HtmlTextWriter writer)
   at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)
   at System.Web.UI.Adapters.ControlAdapter.Render(HtmlTextWriter writer)
   at FormRewriterControlAdapter.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.Control.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.Page.Render(HtmlTextWriter writer)
   at ShowAd_aspx.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 
 
Custom event details:

For more information, see Help and Support Center at


Rafal
Zikbay.com - Free Classifieds
(Search Over 5 mln jobs on Zikbay.com)


DNN Direct
0
rfurdzik
12/24/2007 3:49:23 AM

I did some trace and found out it is caused by Google search crawler...

 

Traceroute

Tracing route to 66.249.66.168
HopTimeHostIPLocation
134.215wsip-70-183-59-1.oc.oc.cox.net70.183.59.1Irvine, CA, United States
234.11368.4.15.968.4.15.9Irvine, CA, United States
39.885ip68-4-14-125.oc.oc.cox.net68.4.14.125Irvine, CA, United States
49.795rsmtdsrj02-ge600.0.rd.oc.cox.net68.4.14.213Irvine, CA, United States
539.983langbbr01-as0.r2.la.cox.net68.1.0.230Fort Walton Beach, FL, United States
623.491cr1-pos-0-2-5-0.lay.savvis.net204.70.203.46New York, NY, United States
724.522ber1-tenge-2-1.losangeles.savvis.net204.70.193.106New York, NY, United States
854.737208.173.57.66208.173.57.66Cary, NC, United States
977.989216.239.43.125216.239.43.125Mountain View, CA, United States
1096.67766.249.95.14866.249.95.148Mountain View, CA, United States
11101.64364.233.175.17164.233.175.171Mountain View, CA, United States
12111.09272.14.232.3772.14.232.37Mountain View, CA, United States
1391.234crawl-66-249-66-168.googlebot.com66.249.66.168Mountain View, CA, United States

 


Rafal
Zikbay.com - Free Classifieds
(Search Over 5 mln jobs on Zikbay.com)


DNN Direct
0
rfurdzik
12/24/2007 3:55:35 AM
how did u fix it ?
Satılık,Kiralık emlak ilanlari
0
erdsah88
12/24/2007 7:57:56 AM

I did not. I am not sure why it happens, but I know the page is invoked by google search crawler.... Anybody knows how to fix it??? 


Rafal
Zikbay.com - Free Classifieds
(Search Over 5 mln jobs on Zikbay.com)


DNN Direct
0
rfurdzik
12/24/2007 2:22:16 PM

 The page in question (from the error in the application log) does not have any leading "..": http://as247gera.zikbay.com/ShowAd.aspx?id=3274

Seems this is some kind of bug in ASP.NET: http://todotnet.com/archive/0001/01/01/7472.aspx?Pending=true 

I have added this to web.config (suggested in http://communityserver.org/forums/p/476049/536640.aspx#536640). Let's see if it helps...

    <authentication mode="Forms">
      <forms cookieless="UseCookies"/>
    </authentication> 


Rafal
Zikbay.com - Free Classifieds
(Search Over 5 mln jobs on Zikbay.com)


DNN Direct
0
rfurdzik
12/24/2007 2:38:39 PM

When the page is being invoked by the Google search it probably is just calling a URL with no parms. Are you handling empty parms at all? Also see is you have any custom controls on your page which are built into DLLs. Review how they handle redirects if no parms supplied.

Do you have any Server.Transfer code there?

 

Hope this helps... 

Tatyana Hughes


Thank you,
Tatyana Hughes
0
AspForumTanya
12/26/2007 2:50:39 PM

 

Hi Friends,

I found the solution for "Cannot use a leading .. to exit above the top directory".

This is the problem caused by master page.Suppose  your master page is in root directory and your content pages are in  subdirectory, then this problem will occur.

This can be avoided by placing copy of the master page(in the  root directory ) into the subdirectory or folder where the content pages are existing.

Now you make changes like the following code into the source file of the page:--

<%@ Page Language="C#" MasterPageFile="main.master" Title="www.metamorfs.com" %>

inseted of

<%@ Page Language="C#" MasterPageFile="~/main.master" Title="www.metamorfs.com" %> 

This is the problem of  ASP.NET Version:2.0.50727.42.

 

If you have a better solution please explain better I'll gladly follow that.

Thank you, 


  www.csharpghost.blogspot.com
1
riyazakt
12/28/2007 6:48:26 AM

u are right but we need a better solution....

 

any body got an idea about this asp.net bug ??


Satılık,Kiralık emlak ilanlari
0
erdsah88
12/28/2007 8:47:10 AM

For that error, how about, instead of the ../ to go to the root folder, use a / or a ~/.  This will ensure that regardless of which folder the master page and content page is it, it can consistently find whatever you are referencing.

Scott


Scott Forsyth
Director of IT
Microsoft MVP - ASP/ASP.NET
ASPInsider

ORCS Web, Inc
www.orcsweb.com
0
OWScott
12/30/2007 12:16:02 AM

If you are going to place a copy of your master page into othere places/folders you are going to end up modifying your code in two places. It is ok if you don't have much going on there but our websites have very complex Master pages and its not a good solution for us to copy the code.

By the way same thing happens to links like <a></a> on Master pages, they don't display correctly in sub folders. The solution is to make them all server controls by adding runat=server and  use tilda sign "~". That makes them render correct.

 

Question: Did you make changes to any code when it suddenly started happening? Think what code changes did you make...and you will find at least the place to look into.

Thanks,

Tatyana


Thank you,
Tatyana Hughes
0
AspForumTanya
1/2/2008 1:35:54 PM

I had the same problem with some of my pages but when i look in my codes i found "~/../../example.aspx"  this on HTML code, so i change it to "../../example.aspx" then it is ok

cheers !!!

 Rukshan Samanthilaka
 


SHAN
0
rukshansamanthilaka
1/12/2008 8:49:03 PM

I had this error when I was working with url rewriting. This is what I was doing;

I had a link like gigznmigz.com/jobs.aspx?JobID=69

And I rewrote like this

gigznmigz.com/jobs/69.aspx

I had my all files in the root folder their are no sub directories. So the problem occurs when i click some link on the page, then the browser looks for that file in /jobs/ directory, but there is no subdirectroy. Therefore it usually gives errors for script, html links. I was getting this error when i tried to signout from the urlrewritten page.

 This is how I solved the issue;

I rewrote my url like gigznmigz.com/job_69.aspx, now this is also considered as a page in the root directory.

I used '_' (underscore) instead of '/' (Slash).

Hope you get this.

0
alisakhi
3/14/2008 10:35:12 AM

Well, this is an interesting way of solving it and you have an interesting cause of the problem. We tried to re-write our urls a while ago but that didn't go through the approval because Marketing had all the links in their materials referenced. Anyway, glad you were able to solve the issue. It is very interesting to watch this post as the same error happens for various reasons in different situations Wink

 

Good luck with your coding!


Thank you,
Tatyana Hughes
0
AspForumTanya
3/14/2008 1:16:55 PM

hi..

im doing url rewriting now..its urgent

actually the current url is below.
                 http://localhost/mysite_UrlRewrite/CompDesc/M/2.aspx

from this page for navigation, url should be like
                 http://localhost/mysite_UrlRewrite/Index.aspx

but it looks like after clicking the link
                 http://localhost/mysite_UrlRewrite/CompDesc/M/Index.aspx

how i've to move out of the folder.. from /CompDesc/M/
i tried the ~ for aquiring root directory..but it won't..

wats wrong..
plz help..thanks in advance

 


-- aruvi
0
arunvinoth
3/26/2008 11:34:52 AM

I'm somewhat familiar with URL rewrite techniques but it is really hard to tell what's wrong by the urls you posted here. I hope somebody else can tell. Sorry...


Thank you,
Tatyana Hughes
0
AspForumTanya
3/26/2008 1:28:29 PM

could you please provide the path you are using to redirect you page. According to me if you want to move from 2.aspx you UrlPath should be "~/mysite_UrlRewrite/inderx.aspx"

0
alisakhi
3/27/2008 1:51:45 AM

 hi,

have you  written the navigation url like

Response.Redirect("~/Index.aspx");

then it should work

 

 

 

0
riyazakt
3/27/2008 5:02:59 AM
Hi, i am having a problem re urlmappings also.
I have a master page with a menu control the menu items are populated using an sql site map provider http://msdn2.microsoft.com/en-us/magazine/cc163657.aspx
I also have some url mapping in my web.config (each time a new page is created the url mapping file is updated, not the best but its ok for now)
 
 
I have run into a major problem and i was wondering if there was any advice
 
The site works fine on the VS dev server, but not on the iis server of any hosting servers
Example
 
There are three pages (and corresponding urlmappings)
 
<urlMappings>
<
add url="~/home.aspx" mappedUrl="~/Default.aspx?pid=70e07b7f-8ed1-4cd5-9d47-8e41d66526c8"/>
<
add url="~/page_a.aspx" mappedUrl="~/Default.aspx?pid=640dcdde-82f6-407d-9a19-b9512be1147e"/>
<
add url="~/page_a/page_aa.aspx" mappedUrl="~/Default.aspx?pid=a4aee100-069c-4f46-b71a-141800994143" />
</
urlMappings>

the first 2 pages i.e. http://mysite/home.aspx and http://mysite/page_a.aspx work fine

its any sub pages that are the problem http://mysite/page_a/page_aa.aspx gives me the error Cannot use a leading .. to exit above the top directory

on the testing page i do not have any links, images, themes, etc... so the only error i can think of relatete to the menu control.

if i use a web.sitemap file this problem doesnt exist only using the sql site map provider which doesnt make sense any help/advice would be great thanks

greeny77

0
grenny77
3/27/2008 8:29:31 PM

Hi Smile Do you ever check your Application Pool ?!!

check that ! That's may be full !

0
Cybergirl
4/28/2008 6:55:31 AM

When you use Rewriting, i recommand respect the same number of directory.
Because there is a lot of possible cause problem:

- image, css, path
- Google spider don't like rewrite with asp.net 2.0
- ...

Example :

If the physical path is :

/directory1/directory2/mypage.aspx

set rewrite with the same number of directory

/MyRewriteToto/Lala/MyPageAndMarketingText.aspx. 


Problem example:
If you set your rewrite /MyRewriteToto/MyPageAndMarketingText.aspx
You have 1 directory in your url rewrite path, but physical url 2
your page referer your css file ../../mycssfile.css

Error = spider try to get css file to 2 directory above and your rewrite have only 1 directory above
 


 


P.Ducret
0
BonusWeb
5/16/2008 12:52:51 PM
 
        case HttpCookieMode.UseDeviceProfile:
            if (context == null)
            {
                context = HttpContext.Current;
            }
            if (context == null)
            {
                return false;
            }
            return (!context.Request.Browser.Cookies || !context.Request.Browser.SupportsRedirectWithCookie);
 

I've been looking into this as I'm getting blasted with error emails from one of our production servers.

Firstly: The reason it happens on production for GoogleBot and not local or for any other requests.

GoogleBot does not accept cookies (I'm assuming this given the evidence) which causes the following code to be executed

(Excerpt from HtmlForm.GetActionAttribute)

 

            // VSWhidbey 202380: If cookieless is on, we need to add the app path modifier to the form action 
bool cookieless = CookielessHelperClass.UseCookieless(Context, false, FormsAuthentication.CookieMode);
if (cookieless && Context.Request != null && Context.Response != null) {
action = Context.Response.ApplyAppPathModifier(action);
}

 
 Looking at the errors stack trace we can see ApplyAppPathModifier is being called for the "bad" requests:

 

   at System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative)

   at System.Web.HttpResponse.ApplyAppPathModifier(String virtualPath)

   at System.Web.UI.HtmlControls.HtmlForm.GetActionAttribute()

 

Most people would have their FormAuthentication cookie mode set to UseDeviceProfile. Heres a peek at CookielessHelperClass.UseCookieless
 
        case HttpCookieMode.UseDeviceProfile:
            if (context == null)
            {
                context = HttpContext.Current;
            }
            if (context == null)
            {
                return false;
            }
            return (!context.Request.Browser.Cookies || !context.Request.Browser.SupportsRedirectWithCookie);
  
I'm trying to figure out how to force my dev environment to also return false for this. I think the answer is to set the cookiemode to UseUri...

-- Sam Critchley

"Wise man say 'forgiveness is divine, but never pay full price for late pizza." - TMNT

shivam.com.au
0
worldspawn
5/26/2008 12:24:35 AM

 Yeh I'm right. On your forms tag in your web.config add (or modify)
    cookieless="UseUri"

Also click on your web project and in the properties dialog set the Virtual Path to just "/". Running the app from a sub folder will not reproduce this error.

Now if you run one of you're rewriting pages you should see your error. Still working out if it's possible to avoid it. Debugging for the dotnet runtime in 2008 is a bit screwed, it never stops on the breakpoints u set so i'm forced to step thru the entire thing. :( 

In my tests the path that UrlPath.ReduceVirtualPath is trying to process looks like this:

"/SharedContent/../../SharedContent/aboutinsuranz.aspx"

Which is quite obviously just screwed up, as that would lead to a path that dipped below the root.
 


-- Sam Critchley

"Wise man say 'forgiveness is divine, but never pay full price for late pizza." - TMNT

shivam.com.au
0
worldspawn
5/26/2008 1:05:03 AM

I've been into this and I can't seem to fool the ApplyAppModifier code into working. It would seem the only way to fix this is to set cookieless="UseCookies" in your forms tag. Obviously this could create additional headaches...

You could also manipulate this by using browser files.
 


-- Sam Critchley

"Wise man say 'forgiveness is divine, but never pay full price for late pizza." - TMNT

shivam.com.au
0
worldspawn
5/26/2008 2:10:38 AM

I had a similar problem with rewriting and was able to solve it with instructions from the Get GoogleBot to crash your .NET 2.0 site article.  Every time I see a new spider cause an error, I end up making a new .browser file.  I am going to work on finding a better way.

http://todotnet.com/archive/0001/01/01/7472.aspx?Pending=true

Thanks,
Dennis
 

0
densom
5/30/2008 1:21:44 PM

Alright, here is another great article that sounds like a better solution.  Let me know if you have any success.

ASP.NET 2.0 UrlRewriting Fix
http://scottwater.com/blog/archive/ASPNET-20-UrlRewriting-Fix/

Thanks,
Dennis
 


 

0
densom
5/30/2008 1:44:29 PM

 It also happens when paths are specified using ../path/ instead of ~ in the server controls paths.

 

0
connect2sandeep
8/22/2008 9:03:56 AM

 I was able to still use Server.Transfer with the following...

My master page had a hyperlink which had a NavigateUrl set as follows... "~/default.aspx". The browser is requesting a non-existent directory so the path it tries to create is something like "../../../default.aspx".

 I changed my master from having the link define the NavigateUrl inline to doing it as part of the page load as follows...

logo.NavigateUrl = ResolveUrl("~/default.aspx");

Since this page gets executed at the page it was transfered to, the server creates the correct path.

 ---

In reading a few more of the posts I see that we're dealing more with css and the above solution won't work for that. One approach I have taken in the past (a little clunky I admit) is to dynamically create a LiteralControl for a <style...> tag and use ResolveUrl("~/style.css") to determine the correct location for the css, then add the control to the Page's Head tag.


Gregor Dzierzon
MCSD, MCDBA, MCT
www.igregor.net

Please remember to click “Mark as Answer” on the post that helps.
0
gdzierzon
11/12/2008 3:19:03 PM
Reply:

Similar Artilces:

Web Deployment project
I have a web deployment project, which gives the following error for one source file while trying to build the solution.  "Cannot use a leading .. to exit above the top directory" The file does not use .. in any URL. The IIS settings (version 5) are "Enable parent path" is checked.  Any ideas? Thanks, ka3751...

Re: "Cannot use a leading .. to exit above the top directory."
riyazakt:I found the solution for "Cannot use a leading .. to exit above the top directory". This is the problem caused by master page.Suppose  your master page is in root directory and your content pages are in  subdirectory, then this problem will occur. This can be avoided by placing copy of the master page(in the  root directory ) into the subdirectory or folder where the content pages are existing. Now you make changes like the following code into the source file of the page:-- <%@ Page Language="C#" MasterPageFile="main.master" Title...

"can not use a leading .. to exit above the top directory" error
I am getting this strange error on the server (app log). I am not sure how to find the causing code. I do not see any code like "..\" I have searched the whole project for that...   NOTE: I see this error is generated by some search engine bot... Any idea. I t is indexing my site and generats this error..  Please advise: The description for Event ID ( 1309 ) in Source ( ASP.NET 2.0.50727.0 ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AU...

RewritePath causing "Cannot use a leading .. to exit above the top directory" error
I've looked at several posts regarding this issues but none of the recommended fixes seem to work.  I tried writing a control adapter using <userAgent match="IE7" /> (this problem happens in IE7...haven't tried other browsers yet) but I still get the error.  I tried putting the UseCookies in the web.config...same error result.  I even modified my call to RewritePath setting the rebaseClientPath flag to true: this worked BUT all my images are broken and the styles are gone.  Does anyone have a solution to this?   Thank you in adv...

why this error really occur?? "Cannot use a leading .. to exit above the top directory. "
i know what this really means but i want to know why this occur ?? is this for the server setting or something in web.Config ( or machine.config ) ??  i had this problem but i couldn't resolved this and i forced to replcae all of my ../ to ~/  and set "runat=server" attribute to   all of my img tags . the amazing is i hadn't any error in my local but when i uploaded my website to server i see this error      any idea ??   Hello, You could check here - http://forums.asp.net/t/1019849.aspx RegardsWindows Hosting ASP.NET | Top ASP.NET Hosts | Dedicated Windows Hosting...

"Using" or "With"
Hi all Please can someone enlighten to me as regards the difference with the "Using" and "With" statement when accessing data - which is better, what are the limitations and/or any pointers. Many thanks. Regards DaveDavid WinchesterPlease mark as answer if this is the solution.  using gives you the ability to use the connection and it closes the connection directlly after you finish using it. and there is no need to try- cach - finaly. there is no limitation on using USING keywordMuhanad YOUNISMCSD.NETMy Blog || My Photos || LinkedIn I have a dataobject the re...

Using "+" or "||"
Using SQLAnywhere 5.5.04, I've gotten into the habit of using "||" in ISQL to indicate a string concatenation. I needed to paste my SQL statement into the PowerBuilder script painter for some embedded SQL, and PB didn't like the "||" very much at all. I changed it to "+" and it seems to be ok. Do these two operators indicate ~exactly~ the same thing? moin, afaik these two's are not the same! if you're using "||" and any term is NULL then in the resultstring the term will be ignored if you use "+" then the resutlstring is NULL mfg ========================== andatec gesellschaft f�r angewandte datentechnik mbh Ruwoldtweg 15 22309 hamburg --------------------------------------- Dipl.-Ing. G�nther Jungbluth gjungbluth@andatec.de ========================== "Rick Charnes" <rick.charnes@state.ma.us> schrieb im Newsbeitrag news:MPG.131a21059f288db49896ba@forums.powersoft.com... > Using SQLAnywhere 5.5.04, I've gotten into the habit of using "||" in > ISQL to indicate a string concatenation. I needed to paste my SQL > statement into the PowerBuilder script painter for some embedded SQL, and > PB didn't like the "||" very much at all. I changed it to "+" and it > seems to be ok. Do these two operators indicate ~exactly~ the same > thing? You are comparing two different "languages" here: Powe...

"Initialize Active Directory for Hosting" Fails
Trying to get HMC set up and installed on a new server; been following the step-by-step instructions included with the software.  Everything's was going smoothly until I got to the "Initialize Active Directory for Hosting" step, at which point I started getting this error: "Only one top level element is allowed in an XML document".  I haven't been able to find any info on this error as it relates to an MPS deployment, and haven't made much progress moving past it.  Here's the proc.xml that provtest is trying to process and failing on:<req...

C#.Net "Double" and "double" When/Where to use?
Hi all     Please let me know the difference between "Double" and "double" in c#.Net (I understand that "Double" is structure      and "double" is an instance to that structure) differences if any thing else.     Also the context in which both has been used.(When/Where to use both). thanks all...      hi,my brains says Double is reference type & double is value type.regards,satishKind Attn: If a reply to your post helped you, kindly mark it as Answered.__________________________________________________Please save Animals Help World Society For Protection Of Animals, Protect these speechless creatures of GOD hi,my brain says Double is reference type & double is value type.regards,satishKind Attn: If a reply to your post helped you, kindly mark it as Answered.__________________________________________________Please save Animals Help World Society For Protection Of Animals, Protect these speechless creatures of GOD Double = double = same thing Puzzles, brain teases, riddles, enigmas: http://www.toysforthebrain.com Both are same. Have a look at thisDifference between Double and doubleThanksMark post(s) as "Answer" that helped youElectronic ScrewWebsite||Blog||Dub@i.net yea es you are right thanks man.regardssatishKind Attn: If a reply to your post helped you, kindly mark it as Answered._____________________________________...

difference between "using System.Web.UI.WebControls" or "System.Web.UI.WebControls.ServerValidateEventArgs"
Hi all, quick question. I'm writing a custom validation method. In the declaration it has: protected void CustomValidator1_ServerValidate(object source, System.Web.UI.WebControls.ServerValidateEventArgs args) Is there any difference between doing that, vs doing: using System.Web.UI.WebControls; protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args) Do they do the same thing? Is it any more efficient when processing the request to do it one way or another? Is there a technical term for what i am talking about? Thanks in advance for any explanation ...

"Net use" not working in application that runs as "system"
Hello, I am trying to create an application object to distribute a program which during the setup procedure creates two local users on the workstation. I tried to set up the application to run as an unsecure system user and start the setup.exe. This method worked fine for quite a number of apps in the past. However this app needs a drive mapping to a windows 2003 server to start the setup.exe. Apparently under windows 2003 it is no longer possible to use the "net use" command when running a script as system user. I get system error 1312 "A specified logon ses...

mapping a drive using "net use" w/no password"
duplicate. -- Regards, Kai Reichert Novell Support Forums Sysop Usually the faulty interface lies between the chair and the keyboard. ...

mapping a drive using "net use" w/no password" #2
I want to set up a test scenario where I have a bunch of clients logging into a Netware server using native file access. My clients use a script file which maps shares to the server using the "net use \\server\share /p=no" (for no password). I keep getting "system error 5 - access is denied". What am I doing wrong and what can I do to fix it? Thanks for your help Assuming you're using Local mode, you must assign a Simple password. Note that a blank Simple password is not the same as never assigning a Simple password. bd NSC Voluntee...

Using Web.sitemap to generate "Next" and "Previous" links
hello,I am familiar with using the SiteMapPath and TreeView controls to generate navigation from my sitemap, but I don't know how to generate "Next" and "Previous" links that will take my user through each .aspx file in a certain category.I use a site.master file for my aspx pages. Can you please help me figure out how to - a) write the hyperlink controls for the "Previous" and "Next" links and tell me whether they should go in the .master file or the .aspx file (also, if there is no "Previous" or "Next" page, the link should not show). b) write the code that assigns the NavigateURL value fo...

"Net use" not working in application that runs as "system" #2
Hello, I am trying to create an application object to distribute a program which during the setup procedure creates two local users on the workstation. I tried to set up the application to run as an unsecure system user and start the setup.exe. This method worked fine for quite a number of apps in the past. However this app needs a drive mapping to a windows 2003 server to start the setup.exe. Apparently under windows 2003 it is no longer possible to use the "net use" command when running a script as system user. I get system error 1312 "A specified logon ses...

.Net 1.1 with .Net 2.0 virtual directory using AJAX "Sys undefined"
I'm having an issue running an AJAX app I built, I think I might know what the problem might be, but if so, I am not sure how to fix it. The main site is built with 1.1 and new application is 2.0.  I have the new application configured properly (as far as I can tell) in its own app pool, etc..  The app runs just fine (I have other 2.0 apps that run along side the main 1.1), but I am getting an error: "Sys undefined...."  I've checked to enusre the mappings for the .axd extension for this particular VD are pointing to the correct place as ...

Replacing "use base" with "use parent"
--bcaec554da9c7514d304ca32ffa3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, From the base.pm documentation<http://perldoc.perl.org/base.html#DESCRIPTIO= N>: Unless you are using the fields pragma, consider this module discouraged in favor of the lighter-weight parent . From the parent.pm documentation<http://perldoc.perl.org/parent.html#HISTOR= Y> : This module was forked from base to remove the cruft that had accumulated in it. parent.pm is a 30 lines pure Perl dual module available also in core since 5.10...

RE: Using "do" versus "use" for subroutine
Edward Wijaya wrote: > Hi, > > I would like to know which of this > is better and what is the pro and cons: > > 1. A file "mysub.pl" which stored > a subroutine, and later called by > main file using: do "mysub.pl" > > or > > 2. A file "mysub.pm" and called > in main file using : use "mysub.pm" The second construct is not valid; the argument to "use" must be a bareword. It's not really possible to answer your question without knowing more details. I'm not clear about what&#...

superreview requested: [Bug 249231] Use only "web site" and "web page" in Firefox : [Attachment 155345] Same as previous with extraneous changes removed
R.J. Keller <rlk@mozdev.org> has asked Ben Goodger <bugs@bengoodger.com> for superreview: Bug 249231: Use only "web site" and "web page" in Firefox http://bugzilla.mozilla.org/show_bug.cgi?id=249231 Attachment 155345: Same as previous with extraneous changes removed http://bugzilla.mozilla.org/attachment.cgi?id=155345&action=edit ------- Additional Comments from R.J. Keller <rlk@mozdev.org> r=rlk@trfenv.com for the help content. Ben, can you review this for 1.0rc1? ...

superreview cancelled: [Bug 249231] Use only "web site" and "web page" in Firefox : [Attachment 155345] Same as previous with extraneous changes removed
Jeff Walden (remove +fxhelp to email) <jwalden+fxhelp@mit.edu> has cancelled R.J. Keller <rlk@mozdev.org>'s request for superreview: Bug 249231: Use only "web site" and "web page" in Firefox http://bugzilla.mozilla.org/show_bug.cgi?id=249231 Attachment 155345: Same as previous with extraneous changes removed http://bugzilla.mozilla.org/attachment.cgi?id=155345&action=edit ------- Additional Comments from Jeff Walden (remove +fxhelp to email) <jwalden+fxhelp@mit.edu> Removing review request from the patch that's now prompt-hindered when applied to aviary... ...

Host Settings "host title" and "host URL" clarification needed
Happy Holidays all! Searched and searched and couldn't find this ... On the Host Settings screen, what are the Host Title and Host URL field used for? Is Host Title just a default that is used as the Site Title when a new portal is created? Not sure what that Host URL gets used for ... Thanks, Marc mhf Marc, I f you look down at the footer of most DNN sites you will see something like "powered by Host Name" or "Hosted by Host Name" where host name is the entry for Host Title and the Host URL is the Hyperlink for the Host web site. If you have...

.ALLCOL("%COLUMN%", " ", ", ", ", ")
Do you know anyway for me to exclude a subset of columns returned by this function. We have two columns (rec_user and rec_datetime) which are in all of our tables, but when generating triggers I want automatically generate a script which does not include those two columns but does include all other columns in that table. Bruce I should add that I am using PD 9.0.0.580. Bruce "Bruce Lamb" <lamb.bruce@mayo.edu> wrote in message news:6HgI315nCHA.155@forums.sybase.com... > Do you know anyway for me to exclude a subset of columns returned by this > function. ...

Web resources about - "Cannot use a leading .. to exit above the top directory." - asp.net.web-hosting

Resources last updated: 3/10/2016 5:23:16 AM