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

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

博客园 - 小二哥

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"%>