我有一个处理程序,需要读取CSS文件的内容,然后输出缩小的内容.
这就是为什么我正在寻找一个可以用作REST api的minifier,因此我可以发送内容,并返回响应以将此内容输出给用户.像Closure编译器REST服务,但对于CSS.
我需要解析一个字符串,所以结果应该像这样输出:
"abc,def,ghi,klm,nop"
Run Code Online (Sandbox Code Playgroud)
但我收到的字符串看起来更像是:
",,,abc,,def,ghi,,,,,,,,,klm,,,nop"
Run Code Online (Sandbox Code Playgroud)
关键是,我事先并不知道有多少逗号分隔了这些词.
我可以在C#中使用正则表达式来帮助我解决这个问题吗?
我正在使用VS2010 Beta 2创建一个全新的母版页,我收到此警告(这会导致我在内容页面中出错):
验证(XHTML 1.0 Transitional):在'script'或'asp:content'区域之外不支持内容.
母版页的代码:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Bob.master.cs" Inherits="TShirtFactory.Web.All.Core.lib.masterpage.Bob" %>
<!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></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
如您所见,它是默认的母版页生成代码.当我将标签悬停在顶部时,我收到警告.有没有人知道发生了什么?
谢谢