コメント
コメントの投稿
※名前とタイトルが入力されていないコメントでは他のコメントとの区別ができません。
入力されていないコメントには返信しませんのであらかじめご了承くださいませ。
<a href="folder3/index.aspx">
http://www.xxx.co.jp/folder1/folder2/folder3/index.aspx
</a>
<a href="./foldere3/index.aspx">
http://www.xxx.co.jp/folder1/folder2/folder3/index.aspx
</a>
<a href="../index.aspx">
http://www.xxx.co.jp/folder1/index.aspx
</a>
<a href="../../index.aspx">
http://www.xxx.co.jp/index.aspx
</a>
<a href="~/product/index/aspx" runat="server">※runat="server"を追加するとチルダでのルート相対参照が動作します。
http://www.xxx.co.jp/product/index.aspx
</a>
<a href="<%= Me.ResolveClientUrl("~/product/index.aspx") %>">※head タグ内での記述には注意点があります。次の「2.ルート相対参照」をご参考ください。
http://www.xxx.co.jp/product/index.aspx
</a>
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site.master.vb" Inherits="RouteRelativeReference.Master.Site" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link runat="server" rel="stylesheet" href="~/App_Data/Styles/Style.css" />
<asp:ContentPlaceHolder ID="cphHeader" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder ID="cphBody" runat="server">
</asp:ContentPlaceHolder>
<p>マスターページコンテンツ</p>
<a href="<%= Me.ResolveClientUrl("~/index.aspx") %>" />ルート相対参照のindex.aspxへ</a>
</div>
<div>
<script type="text/javascript" src="<%=Me.ResolveClientUrl("~/App_Data/Scripts/common.js")%>"></script>
<asp:ContentPlaceHolder ID="cphFooter" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
※名前とタイトルが入力されていないコメントでは他のコメントとの区別ができません。
入力されていないコメントには返信しませんのであらかじめご了承くださいませ。