处理资源时出错:在文本内容中发现无效字符



我在尝试查看网页时遇到以下错误,有人能告诉我解决此错误的原因和解决方案吗:


XML页面无法显示

无法使用样式表查看XML输入。请更正错误,然后单击"刷新"按钮,或者尝试稍后再次。


在文本内容中发现一个无效字符。错误处理资源'http://xxxxxxxxxxx/Auth/Ncoa/pdfviewer.asp...

%

代码隐藏:

public class Ncoa_PdfViewer : Page
{
protected HtmlForm _pdfViewer;
protected void Page_Load(object sender, EventArgs e)
{
ExpressBill.XNet.UI.Services.Ncoa ncoa = new ExpressBill.XNet.UI.Services.Ncoa("NcoaServiceUri");
((WebClientProtocol)ncoa).Timeout = -1;
int clientId = int.Parse(this.Request.QueryString["clientid"]);
byte[] pdfPackage;
if (clientId == 0)
{
NcoaOwner owner = NcoaOwner.GetOwnerForPdfDisplay(this.Session);
NcoaAgent[] agents = NcoaAgent.GetAgentsForPdfDisplay(this.Session);
if (owner == null)
owner = new NcoaOwner();
if (agents == null)
agents = new NcoaAgent[0];
pdfPackage = ncoa.GetPDFPackage(owner, agents);
}
else
pdfPackage = ncoa.GetPDFPackage(clientId);
this.Response.Clear();
this.Response.ContentType = "application/pdf";
this.Response.AddHeader("content-length", Convert.ToString(pdfPackage.Length));
this.Response.BinaryWrite(pdfPackage);
this.Response.Flush();
this.Response.End();
}
}

设计标记:

<%@ Page Language="C#" AutoEventWireup="true" Inherits="ExpressBill.XNet.UI.Ncoa.Ncoa_PdfViewer" Codebehind="PdfViewer.aspx.cs" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Pdf Viewer</title>
</head>
<body>
<form id="_pdfViewer" runat="server">
<div>
</div>
</form>

我认为问题是html无法读取c#或其他内容。如果你想创建一个网站,你可以使用css, js, html, svg, or php,但不能使用c#。如果html可以读取c,那么计算机将很容易被破解。html, js, css, svg, php是不同的编程语言,它们很容易学习。如果你想要更多的细节,你可以搜索w3school或观看youtube开始。

最新更新