惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
博客园_首页
H
Help Net Security
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
B
Blog
I
InfoQ
SecWiki News
SecWiki News
T
Tailwind CSS Blog
Spread Privacy
Spread Privacy
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
N
Netflix TechBlog - Medium
P
Palo Alto Networks Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Vercel News
Vercel News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
K
Kaspersky official blog
M
MIT News - Artificial intelligence
S
Schneier on Security
T
Threat Research - Cisco Blogs
F
Fortinet All Blogs
Cyberwarzone
Cyberwarzone
Scott Helme
Scott Helme
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
The Cloudflare Blog
Recent Announcements
Recent Announcements
Security Latest
Security Latest
G
GRAHAM CLULEY
IT之家
IT之家
Y
Y Combinator Blog
The Last Watchdog
The Last Watchdog
腾讯CDC
Google DeepMind News
Google DeepMind News
V
V2EX
S
Securelist
TaoSecurity Blog
TaoSecurity Blog
B
Blog RSS Feed
S
SegmentFault 最新的问题
博客园 - 叶小钗
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
Project Zero
Project Zero
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
F
Full Disclosure

博客园 - 小二哥

Linq To SQL 针对单张表,有关系的2张表做查询 请问:MOSS使用中机器名与IP地址的问题 MOSS: 如何根据AD帐号判断该用户是否属于网站用户? 在SQL数据库中构造树,直接显示在.Net的DropDownList里 今天解决了K2工作流的,会签与并签问题 钱额的大小写转换的JS代码 郁闷了半个下午的javascript 滑动条的风格控制 DropDownList的SelectedValue和SelectedIndex 分析器错误:访问被拒绝....... 论坛登录页面 iframe自适应问题 今天遇到的几个问题以及解决方法 K2自定义工作流程 .Net中几个容易混淆的概念 郁闷到极点了,VSTO2005问题 ajax实现无刷新两级联动DropDownList 如何从XML字符串获取DataSet Ajax的简单配置与应用.
asp.net页面的Page_Load执行两次
小二哥 · 2006-08-10 · via 博客园 - 小二哥

private void Page_Load(object sender, System.EventArgs e)
  {
   try
   {
       if(!this.IsPostBack)
       {  
          //这里代码需要执行一次
       }
    }
   catch(Exception err)
   {
       throw new Exception("页面加载异常:"+err.Message);
   }
  }

Page_Load中的if(!this.IsPostBack)里的语句只能执行一次,而有的时候,特别是动态增加控件时,里面的语句也会遇到执行多次的情况.
解决方法:
将aspx里的AutoEventWireup属性更改为false即可.
例如:

<%@ Page Language="c#" AutoEventWireup="false" Codebehind="FillTable.aspx.cs" Inherits="camc.workflow.businessflow.FillTable" ClassName="K2SmartForm"%>