日期:2014-05-18  浏览次数:20613 次

aspx页面写pageload方法怎么不执行啊?
<%@ Import Namespace="Tjk.Mall.Components.Utility" %>
<script runat="server">
  public partial class ArticleList : Tjk.Mall.MainWeb.BasePages.BaseMainPage
  {
   
  protected override void Page_Load(object sender, EventArgs e)
  {
  Response.Write("可以的!");
  int cateId = RequestUtility.GetQueryInt("cateid", 0);
  if (cateId <= 0)
  {
  Response.Redirect("/article/index.aspx", true);
  return;
  }
   
  }
  }
  </script>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>淘街客家纺团购商城-床品套件、被子被芯、枕芯枕套、记忆枕、毯子、毛巾浴巾、床单被套、床垫褥子、抱枕坐垫、睡衣 ;厂家直销、厂家配送、优质低价</title>
  <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  <meta name="Keywords" content="淘街客网,团购,四件套、三件套、家纺商城,家纺网上商城,家纺团购,床上用品团购,四件套团购,家纺,床品套件、被子被芯、枕芯枕套、记忆枕、毯子、毛巾浴巾、床单被套、床垫褥子、抱枕坐垫、睡衣 " />
  <meta name="Description" content="淘街客家纺团购商城是目前国内最大、最权威、最专业、品类最多的家纺团购网站,网站所有家纺产品均为厂家直供,以此保证消费者真正购买到市场价格最低、优质、正品的商品;团家纺,上淘街客。" />
  <link rel="shortcut icon" href="/favicon.ico?v=2" />
  <link href="/style/global.css" rel="stylesheet" type="text/css" />
  <link href="/style/style.css" rel="stylesheet" type="text/css" />
</head>
<html>
<body>
  <!-- #include file="/Inc/LoginInc.html"-->
  <!-- #include file="/Inc/MainHeader.html"-->
  <div>
  <form runat="server">
  <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
  </form>
  </div>
  <!-- #include file="/Inc/MainHeaderNav.html"-->
  <!-- #include file="/Inc/MainFooter.html"-->
</body>
</html>

怎么能执行红色的方法



------解决方案--------------------
<script type="text/C#" runat="server">
void Page_Load(object sender, EventArgs e) 
{
Response.Write("搞定!!!!");
}
</script>
------解决方案--------------------
protected override void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);

}
------解决方案--------------------
探讨

引用:

<script type="text/C#" runat="server">
void Page_Load(object sender, EventArgs e)
{
Response.Write("搞定!!!!");
}
</script>


嗯这样是可以的,,,但还要继承Tjk.Mall.MainWeb.BasePages.B……

------解决方案--------------------



让BaseMainPage类继承Page 要么ArticleList 单独提取方法在页面的Page_Load调用