Ahmed’s Dev-Shop

ASP.Net Page loading twice

Posted in .Net, programming, software by Ahmed Siddiqui on June 2, 2008

If you are observing load event twice in a post back in ASP.Net page, check the following:

  • If Page_Load handler defined in Codebehind then AutoEventWireup property should be “false”
  • Check if you have mistakenly multiple event handlers registered for an event
  • Src or ImageURL attribute of your image control are defined and not empty (you can put %20 for blank)
  • bgColor or background is empty

Last two problems usually appears in one browser while disappears in other.

Advertisements

10 Responses

Subscribe to comments with RSS.

  1. vimal saifudin said, on November 9, 2008 at 12:57 pm

    thanks..solved

  2. SteMyers said, on April 17, 2009 at 2:46 pm

    This is a really annoying problem that keeps bobbing up now and again for me, the majority of the time it is caused by one of the problems outlined by you – another cause of the double postback I found out today was SmartNavigation, I spotted an iframe in the source code with the ID ‘__hifSmartNav’ – removed it and it solved the problem.

  3. Matt L. Navarro said, on June 16, 2011 at 8:56 am

    Thanks bro! you’re saving my day…

  4. Thiago Boccio said, on September 8, 2011 at 5:55 am

    It really works!

    Thanks buddy

  5. Brooks said, on April 18, 2012 at 7:48 pm

    In my case my page loading twice caused it to log the user off so it was more than an annoyance. Three days of searching to no avail…finally found your post and it turns out my problem is an image without the ImageURL attribute set. Thank you!

  6. SAJEETH said, on July 18, 2012 at 4:40 pm

    Please find the solution here……..

    1.Juat check your whether the Load event 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**

    1.If it so Just Remove the Me.Load from the event , now check your page. Hope this may be useful for solve your ISsue.
    Needs futher clarifiactions contact me @ -> sajeeth@arrowpointtechnologies.com

    Regards Sajeeth.S Software Engineer Arrowpointtechnologies Ltd. Chennai , India

  7. chandan garg said, on March 13, 2013 at 1:36 pm

    thankyou sir, It was really helpful.

    My problem was the same i was living the image source attribute empty.

  8. NIRAJ KUMAR said, on September 11, 2014 at 11:34 am

    Thanks Ahmed,
    it’s really good .


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: