【发布时间】:2021-12-28 20:07:59
【问题描述】:
我在根目录的子目录中创建了 .aspx 文件。当我尝试访问它时,我得到了
An exception of type 'System.Web.HttpException' occurred in System.Web.dll but was not handled in user code
Additional information: The 'href' property had a malformed URL: Cannot use a leading .. to
exit above the top directory..
当我尝试将 .aspx 的内容更改为纯文本时,它起作用了。但是当我把 ASP 标签放进去时,它没有。
代码如下:
<%@ Page Title="Articles!" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="12-28-2021_11-13AM.aspx.cs" Inherits="WebSite._1.Articles" %>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<hgroup class="title">
<h1><%: Title %></h1>
</hgroup>
</asp:Content>
我得到的答案之一是将“~”更改为“..”,但也没有用。
【问题讨论】: