Tuesday, January 29, 2013

Page_Load executing twice

Correct Page_Load from loading twice
Check to make sure that the .aspx page and .cs page are not both wiring up Page_Load.

.aspx page:

<%@ Page Language="C#" AutoEventWireup="false"...

.aspx.cs code behind:

private void InitializeComponent()

{
     this.Load += new System.EventHandler(this.Page_Load);
}  

If AutoEventWireup="true" and this.Load wires up the Page_Load method, either remove the manual wireup or set AutoEventWireup="false".

No comments: