页面编译模型
不提前编译此页面 直接访问该页面, 结果页面上的事件仍然可以触发,说明页面是在运行时编译的。(代码嵌入时的编译模型)
<%@ Page language="c#" AutoEventWireup="false" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>NewPageNotPreCompileaspx</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
<script language="c#" runat="server">
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Write("button事件触发!");
}
</script>
</head>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<div>这个页面没有被提前编译。</div>
<div>如果Button的事件可以触发,证明 aspx页面是在运行时编译的。</div>
<asp:Button id="btn01" runat="server" text="noPre" OnClick="Button1_Click"></asp:Button>
</form>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>NewPageNotPreCompileaspx</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
<script language="c#" runat="server">
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Write("button事件触发!");
}
</script>
</head>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<div>这个页面没有被提前编译。</div>
<div>如果Button的事件可以触发,证明 aspx页面是在运行时编译的。</div>
<asp:Button id="btn01" runat="server" text="noPre" OnClick="Button1_Click"></asp:Button>
</form>
</body>
</html>
<%@ Page language="c#" AutoEventWireup="false" %>