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. Post Back

Post Back

Scheduled Pinned Locked Moved ASP.NET
questiondatabasedebugging
2 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.
  • S Offline
    S Offline
    sroberts82
    wrote on last edited by
    #1

    I have a question about the Post Back, I dont think Ive really got it yet. I have a form with checkboxes and a submit button. I put in a break point in the page load method and my onClick method of the button. First time, page loads, grand. Checkbox values are populated from a DB grand. Then I change the values of the check boxes and click submit. The first breakpoint i encounter is the one in page load, which reloads the checkbox values from the DB and then these go into the onClick method. So my question is why is the order pageload, click submit, page load, onClick method? Ive tried putting the generation of the checkboxes in a if(!page,ispostback) but then in the submit method i call FindControl and it cant find them because I guess they were never created. What I want to know is why is this second pageload in there? I dont want it and its wrecking things. Thanks in advance,

    V 1 Reply Last reply
    0
    • S sroberts82

      I have a question about the Post Back, I dont think Ive really got it yet. I have a form with checkboxes and a submit button. I put in a break point in the page load method and my onClick method of the button. First time, page loads, grand. Checkbox values are populated from a DB grand. Then I change the values of the check boxes and click submit. The first breakpoint i encounter is the one in page load, which reloads the checkbox values from the DB and then these go into the onClick method. So my question is why is the order pageload, click submit, page load, onClick method? Ive tried putting the generation of the checkboxes in a if(!page,ispostback) but then in the submit method i call FindControl and it cant find them because I guess they were never created. What I want to know is why is this second pageload in there? I dont want it and its wrecking things. Thanks in advance,

      V Offline
      V Offline
      V 0
      wrote on last edited by
      #2

      read up on the page life cycle[^]. Coulda, woulda, shoulda doesn't matter if you don't.

      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