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...
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:
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
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.
san.prabu_k
Member
2 Points
1 Post
Re: "Cannot use a leading .. to exit above the top directory."
Oct 01, 2007 06:41 AM|LINK
We got same problem.at that time we deleted one "webinfo" file from application .then it is working fine.
AspForumTany...
Member
207 Points
113 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Nov 14, 2007 04:18 PM|LINK
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
erdsah88
Contributor
3453 Points
930 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Dec 17, 2007 05:58 AM|LINK
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 ?
AspForumTany...
Member
207 Points
113 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Dec 17, 2007 01:44 PM|LINK
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
rfurdzik
Contributor
3439 Points
1731 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Dec 24, 2007 02:49 AM|LINK
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
Buy Sell Domains - DomainsHeat.com
Free ASP.NET controls: Youtube Web Control and Ajax Zoom Control
rfurdzik
Contributor
3439 Points
1731 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Dec 24, 2007 02:55 AM|LINK
I did some trace and found out it is caused by Google search crawler...
Traceroute
Tracing route to 66.249.66.168Buy Sell Domains - DomainsHeat.com
Free ASP.NET controls: Youtube Web Control and Ajax Zoom Control
erdsah88
Contributor
3453 Points
930 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Dec 24, 2007 06:57 AM|LINK
rfurdzik
Contributor
3439 Points
1731 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Dec 24, 2007 01:22 PM|LINK
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???
Buy Sell Domains - DomainsHeat.com
Free ASP.NET controls: Youtube Web Control and Ajax Zoom Control
rfurdzik
Contributor
3439 Points
1731 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Dec 24, 2007 01:38 PM|LINK
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>
Buy Sell Domains - DomainsHeat.com
Free ASP.NET controls: Youtube Web Control and Ajax Zoom Control
AspForumTany...
Member
207 Points
113 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Dec 26, 2007 01:50 PM|LINK
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