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
I solved my issue by setting the AutoEventWireUp attribute to FALSE. I got this issue when migrating from .net 1.1 to .net 4.0. Somehow VS2012 reset this attribute to TRUE when I copy the file over from the older version.
For me it was solved by removing
Handles Me.Load
and changing the method like
Protected Overrides OnLoad(...)
The Page object calls the OnLoad method on the Page object, and then recursively does the same for each child control until the page and all controls are loaded. The Load event of individual controls occurs after the Load event of the page.
Use the OnLoad event method to set properties in controls and to establish database connections.
Reffer MSDN: enter link description here
I had the same issue. It was because of a TreeNode with ImageUrl="".
For me I could get around this calling multiple times by using the PreRender event instead
protected override void OnPreRender(EventArgs e)
This is only called once, even if the onload's and init's are called a million times.
Please find the solution here........
Check if the Load events have Handlers for Base class and the child class
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load, Me.Load**
If it is just Remove the Me.Load from the event , now check your page. Hope this may be useful and solve your issue.