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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Page_Load firing 2 times

Page_Load firing 2 times

Scheduled Pinned Locked Moved ASP.NET
question
4 Posts 2 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.
  • P Offline
    P Offline
    pinna_hari
    wrote on last edited by
    #1

    Hello, Page_load event is firing two times, what may be the reason, what is the solution. Thanks in advance.

    Pinna

    E 1 Reply Last reply
    0
    • P pinna_hari

      Hello, Page_load event is firing two times, what may be the reason, what is the solution. Thanks in advance.

      Pinna

      E Offline
      E Offline
      Expert Coming
      wrote on last edited by
      #2

      Page_Load runs every post back. You can try wrapping the code in a if(!IsPostBack)...

      The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

      P 1 Reply Last reply
      0
      • E Expert Coming

        Page_Load runs every post back. You can try wrapping the code in a if(!IsPostBack)...

        The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

        P Offline
        P Offline
        pinna_hari
        wrote on last edited by
        #3

        Thanks for response.. i wrote the code like that only..if(!IsPostBack)...still page_load is firing two times.. i wrote the code like below.. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Try If Not IsPostBack Then lblUserDet.Text = Session("LoginName") End If end sub

        Pinna

        E 1 Reply Last reply
        0
        • P pinna_hari

          Thanks for response.. i wrote the code like that only..if(!IsPostBack)...still page_load is firing two times.. i wrote the code like below.. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Try If Not IsPostBack Then lblUserDet.Text = Session("LoginName") End If end sub

          Pinna

          E Offline
          E Offline
          Expert Coming
          wrote on last edited by
          #4

          What makes you think it is firing 2 times?

          The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

          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