我在 root 的子目錄中創建了 .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>
我得到的答案之一是將“~”更改為“..”,但這也不起作用。
uj5u.com熱心網友回復:
看起來問題出在 Site.Master 檔案上。通過將 Site.Master 檔案中的 hrefs 中的“..”替換為“~”解決了問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/400938.html
上一篇:c#按鈕單擊輸入值回傳空
