名称以无效字符开头。处理资源时出错

名称以无效字符开头。处理资源时出错

这是我尝试从已发布文件夹启动 default.aspx 文件时遇到的确切错误。有人能给我指出正确的方向吗?

The XML page cannot be displayed 
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. 


--------------------------------------------------------------------------------

A name was started with an invalid character. Error processing resource 'file:///C:/inetpub/wwwroot/MHNProServices/Default....

<%@ Page Title="" Language="C#" MasterPageFile="~/ProServices.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs"...

以下是 default.aspx 的内容

<%@ Page Title="" Language="C#" MasterPageFile="~/ProServices.Master" AutoEventWireup="False" CodeBehind="Default.aspx.cs" Inherits="MHNProServices.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link type="text/css" href="css/Default.css" rel="Stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div id="contentHead">
           <img src="css/img/heading_landing.jpg" />
    </div>
    <div id="contentTop"></div>
    <div id="content">
        <div id="contentLeft">
            <asp:Image ID="displayPicture" runat="server" />
            <img id="displayOverlay"src="css/img/profilepicture_overlay.gif" />

            <a id="contentButton_makeAppointment" href="Appointments.aspx?step=start"></a>
            <a id="contentButton_cancelAppointment" href="Appointments.aspx?step=cancel"></a>
        </div>
        <div id="contentRight">
                <h3><asp:Label ID="lbl_homepageHeader" runat="server" Text=""></asp:Label></h3>
                <hr />
                <asp:Label ID="lbl_homepageContent" runat="server" Text=""></asp:Label>
        </div>
    </div>
    <div id="contentBottom"></div>
</asp:Content>

答案1

这是因为我直接从发布到的文件夹启动了 .aspx 文件 - 我需要将其放在 IIS 服务器上。哎呀!

答案2

如果看不到文件的内容(C:/inetpub/wwwroot/MHNProServices/Default....)或引用此内容的代码,那么这必然只是猜测。

文件中存在无效字符,或者'文件名开头的 表示对该文件的引用不正确。

相关内容