Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. the usual annoying absurdity

the usual annoying absurdity

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tiwal
    wrote on last edited by
    #1

    I have a very very simple asp.net application with a very very simple page on it, the defaul.aspx. In the page's code behind I have the usual Page_Load handler where I simply ask myself if it is a postback or not ( if (!IsPostBack) {...}). How is it possible that, without having any controls on the page, I run into the !IsPostBack three times as I simply call the page ? It is like the page is called three times .... Is there any explaination to this ridiculous behaviour ? MSDN doesn' t absolutely talk about details of Load event , it just says it is called at a certain point of the "page life cicle" .-...

    F Richard DeemingR 2 Replies Last reply
    0
    • T tiwal

      I have a very very simple asp.net application with a very very simple page on it, the defaul.aspx. In the page's code behind I have the usual Page_Load handler where I simply ask myself if it is a postback or not ( if (!IsPostBack) {...}). How is it possible that, without having any controls on the page, I run into the !IsPostBack three times as I simply call the page ? It is like the page is called three times .... Is there any explaination to this ridiculous behaviour ? MSDN doesn' t absolutely talk about details of Load event , it just says it is called at a certain point of the "page life cicle" .-...

      F Offline
      F Offline
      F ES Sitecore
      wrote on last edited by
      #2

      Something is requesting your page multiple times. Maybe it's a misunderstanding about master pages? Or update panels? As you haven't posted any code or given any relevant details and we can't access your system I'm not sure how you are expecting someone to help. Use a tool like Fiddler to capture the network traffic and see if that will help you determine where the requests are coming from.

      1 Reply Last reply
      0
      • T tiwal

        I have a very very simple asp.net application with a very very simple page on it, the defaul.aspx. In the page's code behind I have the usual Page_Load handler where I simply ask myself if it is a postback or not ( if (!IsPostBack) {...}). How is it possible that, without having any controls on the page, I run into the !IsPostBack three times as I simply call the page ? It is like the page is called three times .... Is there any explaination to this ridiculous behaviour ? MSDN doesn' t absolutely talk about details of Load event , it just says it is called at a certain point of the "page life cicle" .-...

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        Since you haven't provided any code, I'll have to take a guess: your event handler is wired up multiple times. There are several ways event handlers can be wired to events in ASP.NET; if you've used more than one, then the event will be fired multiple times.

        • If AutoEventWireup[^] is set to "True", methods with names like Page_Load will automatically be wired up to the equivalent event.
        • If you're using VB.NET, adding the Handles clause to a method will wire it up to the specified event.
        • If you have an OnEventName="Handler" attribute in your markup, that method will be wired up to the specified event.
        • If you have a default.aspx.designer.cs / default.aspx.designer.vb file in your project, you might find that it contains code to wire up the event handler.

        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups