Asp.net page_load function is loading twice.. hence it affects my page performance. Does anyone know the reason it is loading twice.
No, iam not calling the page loa
Remember to check the IsPostBack value as shown below:
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
You can put breakpoints inside this IF block to verify you running Page_Load twice. If you are seeing Page_Load run twice and each time it is not a postback, then check the OnInit() method for this page. Verify you are not wiring up the Load handler like below. You will see this code often from code that was migrated from earlier versions of Visual Studio.
this.Load += new System.EventHandler(this.Page_Load);
Remove this if you find it. This assumes that you have the following at the top of the markup for the page. AutoEventWireup="true"