gpt4 book ai didi

asp.net - 无法使用前导 .. 退出顶级目录错误

转载 作者:行者123 更新时间:2023-12-02 03:56:26 24 4
gpt4 key购买 nike

“不能使用前导 .. 退出顶级目录”我在我的项目中使用 Windows 身份验证,当我将表单设置为起始页时,出现上述错误。请提出建议

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

最佳答案

这意味着您的网页引用了您网页上一级文件夹中的内容,但您的网页已经在网站的根文件夹中,因此相对路径无效。从您的异常消息来看,问题似乎是由图像控件引起的。

你必须有这样的东西:-

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

但由于页面本身位于网站的根文件夹中,因此它不能引用上一级的内容,这正是领先的 ..\ 正在做的事情。

关于asp.net - 无法使用前导 .. 退出顶级目录错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12384924/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com