关于Asp.net页面Page_Load被执行两次的问题

来源:互联网 发布:淘宝买家买高仿货骗术 编辑:程序博客网 时间:2024/05/16 10:19
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
在写Aspx的时候,不注意把AutoEventWireup="false"去掉,你可能会死得很难看,

Page_Load部分会在一次页面加载的时候执行两次哦!千万注意不要去掉Aspx中的

AutoEventWireup="false"设置。

<%@ Page language="c#" Codebehind="ShowSimpleFactory.Aspx.cs" AutoEventWireup="false" Inherits="test.DesignPatternTest.ShowSimpleFactory" %>

<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击