aspx页面生成的空行
2 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="XXX.Default" %> <!DOCTYPE html> 3 <html> 4 <head runat="server"> 5 <title></title> 6 </head> 7 <body> 8 <div> 9 <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> 10 </div> 11 </body> 12 </html>
这样的 页面生成会有两行空行
2<!DOCTYPE html> 3 <html> 4 <head runat="server"> 5 <title></title> 6 </head> 7 <body> 8 <div> 9 <span>Label</span> 10 </div> 11 </body> 12 </html>
去掉空行很简单
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="XXX.Default" %><!DOCTYPE html><html> <head runat="server"> <title></title> </head> <body> <div> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </div> </body> </html>