0

我正在尝试将 feed.asp 嵌入到 Page.cshtml 中。但它不会编译命令。这是页面的代码。

@{

}

<!DOCTYPE html>

<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>ONC Project Tracking</title>
        <style type="text/css">
        .auto-style1 {
            text-align: center;
            font-family: Verdana, Geneva, Tahoma, sans-serif;
            font-weight: bold;
            color: #800000;
        }
        .auto-style2 {
            text-align: justify;
            font-family: Verdana, Geneva, Tahoma, sans-serif;
        }
        .auto-style3 {
            font-family: Verdana, Geneva, Tahoma, sans-serif;
        }
        .auto-style4 {
            text-align:center;
            margin-left:auto;
            margin-right:auto;
            border: 0px solid black;
        }
        .auto-style4 tr {
            width: 30%;
        }
        .auto-style4 td {
            border: 0px solid black;
            padding: 0px;
            border-collapse:collapse;
            border-spacing: 0px;
        }
        .auto-style5 {
            max-width: 50%;
        }
        .auto-style11 {
            width: 1077px;
            height: 283px;
        }

    </style>
    </head>
    <body>
        <p class="auto-style1">
        Welcome to the ONC project tracking JIRA system</p>
    <p>
        &nbsp;</p>
    <p class="auto-style2">
        Welcome to the ONC project tracking JIRA system. The Nationwide Health Information Network Division of the Office of National Coordinator maintains the system to provide a collaborative environment for the healthcare industry to implement meaningful use requirements. Below please find links to numerous projects that are hosted on the project tracking system, as well as a summary of the hot topics being discussed. Within each project you will find conversations related to implementing specific meaningful use measures.</p>
    <p class="auto-style3">
        If you have questions about meaningful use direct them to <a href="mailto:mindy.hangsleben@hhs.gov">mindy.hangsleben@hhs.gov</a>. If you&#39;re having technical problems with this site please contact onc-jira@ainq.com.</p>

        <hr>

    <table class="auto-style4">
        <tr>
            <td>
                <img alt="" class="auto-style5" src="high-priority-tickets-button.png" /></td>
            <td>
                <img alt="" class="auto-style5" src="hot-tickets-button.png" /></td>
            <td>
                <img alt="" class="auto-style5" src="issues-due-this-week-button.png" /></td>
        </tr>
        <tr>
            <td>
                <img alt="" class="auto-style5" src="create-a-ticket-button.png" /></td>
            <td>
                <img alt="" class="auto-style5" src="latest-tickets-button.png" /></td>
            <td>
                <img alt="" class="auto-style5" src="my-new-tickets-button.png" /></td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td>
                <img alt="" class="auto-style5" src="my-profile-button.png" /></td>
            <td>&nbsp;</td>
        </tr>
    </table>



   < !--#include virtual="feed.asp"-->

    </body>
</html>

输出有 '< !--#include virtual="feed.asp"-->' 而不是渲染 asp 页面的内容。

4

2 回答 2

1

这只是行不通。

如果您绝对必须包含此 asp 文件,请尝试使用<iframe>- 但即便如此,您也很难让 asp 在 IIS7 中运行(假设应用程序在 IIS7 上运行)

于 2013-07-25T17:59:49.480 回答
0

我假设您的项目是某种 ASP.NET C# Web 应用程序(MVC、站点或其他)。这意味着您的默认页面语言是 C#。如果您能够让服务器端包含工作,编译器会期望包含的文件也是相同的语言。你不能混合和匹配语言。

我通过 .ASP 扩展名假设文件源是经典 ASP 时代的 VBScript?如果是这样,您将无法结合经典的 ASP 和 ASP.NET。

如果出于某种原因 feed.asp 是一个仅具有经典扩展名的 .NET 文件,Response.WriteFile("myFile.aspx")则可以包含另一个文件,但我相信该文件也需要在 C# 中。如果您使用的是 MVC,则可以使用Html.RenderPartial

一些资源供您阅读:

相当于服务器端的 ASP.NET 包括

http://support.microsoft.com/kb/306575

于 2013-07-25T21:44:26.893 回答