Page being loaded twice

by Johan Driessen 3. December 2008 10:08

Ever had the problem of pages being loaded twice, that is that all the events are being hit two times?

I have, and I've never really been able to figure out why, but I recently stumbled over this old entry at ASP.NET Resources. It seems that it is a problem with AutoEventWireup, or rather it is a problem if you use both AutoEventWireup and wire the events in the codebehind as well. You can read the full story on ASP.NET Resources, but it seems that it is obviously very important to be consistent in your choice of using AutoEventWireup or overriding the methods, and not using both of them!

I know we have this problem in our current project, so I guess I'd better track down all Page_Something-methods and AutoEventWireups and turn them off. Seems to be the easiest way to get rid of this.

Tags: ,

Development

blog comments powered by Disqus

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 2.5 Sweden License.


Welcome to the Dropit blog!

Here we, the people that work at Dropit, will write about stuff that interests us. For example web development, especially with .NET and EPiServer - but we'll also talk about other techniques that interest us, marketing on the web, social phenomenons, pop culture, games and software development in general.