Я создал мастер-страницу с папкой подменю под названием «County_Polices». В подпапке у меня есть файл «Cty_911_calltaking.aspx».
На главной странице я попробовал 3 приведенных ниже сценария, и ни один из них не откроет файл aspx в подпапке.
<li><a href = "#">911 Calltaking Polices</a>
<ul>
<li><li>
<li><a runat = "server" href = "~/Cty_911_calltaking.aspx">County Police</a></li>
<li><a href = "<%=ResolveUrl("~/Cty_911_calltaking.aspx") %>">County Police 1</a></li>
<li><a href = "~/County_Polices/Cty_911_calltaking.aspx">County Police 2</a></li>
</ul>
Что я делаю не так.
Это исходный код страницы Cty_911_calltaking.aspx:
<%@ Page Title = "" Language = "C#" MasterPageFile = "~/MasterPage.Master" AutoEventWireup = "true" CodeBehind = "Cty_911_calltaking.aspx.cs" Inherits = "OnCallWeb.County_Polices.Cty_911_calltaking" %>
<asp:Content ID = "Content1" ContentPlaceHolderID = "head" runat = "server">
<style type = "text/css">
.auto-style1 {
width: 100%;
}
.auto-style2 {
text-align: center;
}
.auto-style3 {
font-size: xx-large;
color: #009999;
}
.auto-style4 {
text-align: center;
font-size: x-large;
}
</style>
</asp:Content>
<asp:Content ID = "Content2" ContentPlaceHolderID = "ContentPlaceHolder1" runat = "server">
</asp:Content>
<asp:Content ID = "Content3" ContentPlaceHolderID = "ContentPlaceHolder2" runat = "server">
test<table class = "auto-style1">
<tr>
<td class = "auto-style2"><em><strong><span class = "auto-style3">Header</span></strong></em></td>
</tr>
<tr>
<td class = "auto-style2"> </td>
</tr>
<tr>
<td class = "auto-style4">Enter text here</td>
</tr>
<tr>
<td class = "auto-style2"> </td>
</tr>
</table>
</asp:Content>





Не обращайте внимания, я нашел ошибку. Была простая опечатка. Использование приведенного ниже кода работает:
<li><a href = "<%=ResolveUrl("~/County_Polices/Cty_911_calltaking.aspx")%>">County Police 1</a></li>