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. General Programming
  3. C#
  4. Running Page_Load Event

Running Page_Load Event

Scheduled Pinned Locked Moved C#
helpdatabasequestion
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.
  • G Offline
    G Offline
    Gavin_Mannion
    wrote on last edited by
    #1

    Hi All, I am having an annoying problem that hopefully you can explain to me. I have some code in my Page_Load event that load previous data into all the textboxes on a form. I then enter my new data and submit, but for some reason it is clearing all the data in my form before submitting, the only reason that I can come up with is that it is loading the Page_Load event which is populating the form with blanks from my database? Does this make any sense and can I fix this? Thanks, Gavin

    A 1 Reply Last reply
    0
    • G Gavin_Mannion

      Hi All, I am having an annoying problem that hopefully you can explain to me. I have some code in my Page_Load event that load previous data into all the textboxes on a form. I then enter my new data and submit, but for some reason it is clearing all the data in my form before submitting, the only reason that I can come up with is that it is loading the Page_Load event which is populating the form with blanks from my database? Does this make any sense and can I fix this? Thanks, Gavin

      A Offline
      A Offline
      AndyG
      wrote on last edited by
      #2

      try this: if(!IsPostBack) { //Populate TextBoxes } Andy Gaskell, MCSD MCDBA

      G 1 Reply Last reply
      0
      • A AndyG

        try this: if(!IsPostBack) { //Populate TextBoxes } Andy Gaskell, MCSD MCDBA

        G Offline
        G Offline
        Gavin_Mannion
        wrote on last edited by
        #3

        That solves it.. Thanks, Is there a decent reason on why it is running the Load_Page after I push submit and before the actual submit?

        A 1 Reply Last reply
        0
        • G Gavin_Mannion

          That solves it.. Thanks, Is there a decent reason on why it is running the Load_Page after I push submit and before the actual submit?

          A Offline
          A Offline
          AndyG
          wrote on last edited by
          #4

          This might help. Andy Gaskell, MCSD MCDBA

          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