C#网页模板引擎 SharpDOM

码农软件 · 软件分类 · 模板引擎 · 2019-08-24 19:29:51

软件介绍

SharpDOM 可以让你直接使用 C# 的语法来编写网页,举个例子:

下面是一段HTML代码:

<html>
<head>
<title>Title of the page</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link href="css/style.css" rel="stylesheet" type="text/css">
<script href="/JavaScripts/jquery-1.4.2.min.js" type="text/javascript">
</head>
<body>
<div>
<h1>Test Form to Test</h1>
<form id="Form1" type="post">
<label>Parameter</label> =
<input type="text">Enter value</input>
<input type="submit" text="Submit !" />
</form>
<div>
<p>Textual description of the footer</p>
<a href="http://google.com">
<span>You can find us here</span>
</a>
<div>
Another nested container
</div>
</div>
</div>
</body>
</html>

使用 SharpDOM 来编写的话,就变成了

html[
head[
title[ "Title of the page" ],
meta.attr(http-equiv: "contenttype", content: "html", charset: "utf-8"),
link.attr(href: "css/style.css", rel: "stylesheet", type: "css"),
script.attr(href:"/JavaScripts/jquery-1.4.2.min.js", type: "javascript")
],
body[
div[
h1[ "Test Form to Test" ],
form.attr(id: "Form1", type: "post")[
label[ "Parameter" ], "=", input.attr(type:"text", value: "Enter value"), br,
input.attr(type: "submit", value: "Submit !")
],
div[
p[ "Textual description of the footer" ],
a.attr(href: "http://google.com" )[
span[ "You can find us here"]
]
],
div[ "Another nested container" ]
]
]
]

本文地址:https://codercto.com/soft/d/13090.html

热搜:搜索排名营销大揭秘

热搜:搜索排名营销大揭秘

【美】肖恩·布拉德利 / 中国人民大学出版社有限公司 / 2018-7-30 / CNY 55.00

首部大数据在我国政府管理场景中的应用实践案例读本,全面展示我国电子政务与数字化建设的成果,深度理解实施国家大数据战略的重要意义。 本书作者作为国内最早从事大数据应用研究的实践者之一,亲历了中国大数据的发展历程、主要事件、应用案例以及行业变化。 在本书中,作者将其所亲历的大数据发展历程进行了阐述,从大数据的基本概念、特点到实践解读,通俗易懂,给我们的实际工作提供了重要参考。作者将帮助读者......一起来看看 《热搜:搜索排名营销大揭秘》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具