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. PostBack Problem

PostBack Problem

Scheduled Pinned Locked Moved Web Development
helpquestiontutorial
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.
  • M Offline
    M Offline
    mominafiz
    wrote on last edited by
    #1

    hi. i m having problem with post back. i m having my .vb file in which i got my edit button even sub and save btn event sub. i m declaring ( dim flag as integer =-1 )on page load event. on clicking on edit button flag becomes 1 and in save btn event i got my condition if flag=1 then end if when i hit edit flag becomes 1 and on clicking on save button, the button's postbck event is called and due to post back the flag is initialised to -1. i know what is postback and how it works .but m not aware how to handle it.. can anyone help how to come out of this situation??

    enhzflepE R 2 Replies Last reply
    0
    • M mominafiz

      hi. i m having problem with post back. i m having my .vb file in which i got my edit button even sub and save btn event sub. i m declaring ( dim flag as integer =-1 )on page load event. on clicking on edit button flag becomes 1 and in save btn event i got my condition if flag=1 then end if when i hit edit flag becomes 1 and on clicking on save button, the button's postbck event is called and due to post back the flag is initialised to -1. i know what is postback and how it works .but m not aware how to handle it.. can anyone help how to come out of this situation??

      enhzflepE Offline
      enhzflepE Offline
      enhzflep
      wrote on last edited by
      #2

      mominafiz wrote:

      i know what is postback and how it works .but m not aware how to handle it..

      Methinks this seems like a contradiction.

      1 Reply Last reply
      0
      • M mominafiz

        hi. i m having problem with post back. i m having my .vb file in which i got my edit button even sub and save btn event sub. i m declaring ( dim flag as integer =-1 )on page load event. on clicking on edit button flag becomes 1 and in save btn event i got my condition if flag=1 then end if when i hit edit flag becomes 1 and on clicking on save button, the button's postbck event is called and due to post back the flag is initialised to -1. i know what is postback and how it works .but m not aware how to handle it.. can anyone help how to come out of this situation??

        R Offline
        R Offline
        Rhys Jacob
        wrote on last edited by
        #3

        Your page_load event will get called each time there is a postback. So when you click your save button it's setting your flag back to -1. you should look at:

        page.isPostBack

        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