문제

DocType을 XHTML Strict로 지정하지만 텍스트/HTML의 콘텐츠 유형으로 와이어를 통해 전송되고 있습니다. 컨텐츠 유형이 Application/XHTML+XM임을 지정하고 싶지만 응용 프로그램 내에서 어디에서 구성 할 수 있는지 알 수 없습니다.

도움이 되었습니까?

해결책

@ page 속성 섹션에서 다음과 같이 지정할 수 있습니다.

<%@ Page ContentType="application/xhtml+xm" %>

... 더 MSDN.

다른 팁

파일 뒤에있는 코드에서 Page_load 이벤트 중에 다음 코드를 추가하십시오.

Response.Clear()
Response.ContentType = "application/xhtml+xm"

========= ASPX ==============

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>


<asp:literal runat="server" id="dt"></asp:literal>


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

============== CODE 뒤에 =========

protected void Page_Load(object sender, EventArgs e)
{
this.dt.Text= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0
Transitional//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";

}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top