Becks
Becks

Reputation: 77

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

"Cannot use a leading .. to exit above the top directory" I am Using windows authentication in my project,when i set a form as a startpage i get th above error.please suggest

<%@ Page Title="" Language="C#" MasterPageFile="~/TravelsMaster.master" AutoEventWireup="true"
    CodeBehind="AgentMaster.aspx.cs" Inherits="TravelsManagementSystem.Forms.Master.AgentMst.AgentMaster" %>

Upvotes: 3

Views: 6596

Answers (1)

Viral Shah
Viral Shah

Reputation: 2246

What this means is that your web page is referring to content which is in the folder one level up from your page, but your page is already in the website's root folder, so the relative path is invalid. Judging by your exception message it looks like an image control is causing the problem.

You must have something like:-

<asp:Image ImageUrl="..\foo.jpg" />

But since the page itself is in the root folder of the website, it cannot refer to content one level up, which is what the leading ..\ is doing.

Upvotes: 1

Related Questions