如何在单页面aspx中实现继承(2.0)
我编了类继承自System.Web.UI.Page,
public class mywebpage : System.Web.UI.Page
{
protected override void OnLoad(EventArgs e)
{
Response.Write( "BASEWrite ");
base.OnLoad(e);
}
}
想把aspx页面改成从我编写的类继承,当aspx也代码页分离时,很好写,这样就可以了
public partial class Default10 : mywebpage
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write( "cc ");
}
}
但在aspx和和代码页在一起的时候,不知道该怎么写这样的代码
<%@ Page Language= "C# " %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<script runat= "server ">
protected void Page_Load(object sender, EventArgs e)
{
Response.Write( "dd ");
}
</script>
<html xmlns= "http://www.w3.org/1999/xhtml " >
<head runat= "server ">
<title> 无标题页 </title>
</head>
<body>
<form id= "form1 " runat= "server ">
<div>
aaa
</div>
</form>
</body>
</html>
------解决方案---------------------_-#...那我接分吧...