将aspx.cs代码写到前台页面中

<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html>
<html>
<head>
<title>sleepTest</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<%=date %>

<%
Response.Write("a");
Response.Write("b");
Response.Write("c");
%>
</div>
</form>
</body>
</html>
<script runat="server">
string date;
protected void Page_Load(object sender, EventArgs e)
{
date = DateTime.Now.ToString();
}
</script>

posted @ 2016-01-11 13:48  飞雷神  阅读(1135)  评论(0编辑  收藏  举报