自定义控件 加入include 报错 问题

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Head_Index.ascx.cs" Inherits="Head_Index" %>
<%@ Register Src="TopBoards.ascx" TagName="TopBoards" TagPrefix="uc1" %>


<!--#include file=" /Common/head/head.html"-->

<uc1:TopBoards ID="TopBoards1" runat="server" />

<div id="Landing_big" style="960px;">
<div id="dvUnLogin" runat="server" class="Landing_1" style="float:left;960px;">
<iframe ID="loginFr" src="qbaobei_login.htm" frameborder="0" scrolling="no" width="100%" height="26" allowtransparency="true"></iframe>
</div>
</div>
报未知路径错误  
<!--#include file=" /Common/head/head.html"-->
改成
<!--#include file=" <%= ResolveUrl("/Common/head/head.html") %>"-->
就行了



原文地址:https://www.cnblogs.com/jonhson/p/2194815.html