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. public boolean var always resets to false

public boolean var always resets to false

Scheduled Pinned Locked Moved ASP.NET
question
3 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.
  • C Offline
    C Offline
    cavall
    wrote on last edited by
    #1

    I have a public boolean var that is always resetting to false even though I have set it to be true in the final method of the code. I have a calendar object that when the first date is selected it will populate the "startDate" text box with that date, then set the public boolean IsStartDate = True. Upon the next selected date on the calendar the "endDate" text box will be populated with that specific date b/c the IsStartDate boolean var should be set to True now. So... the boolean should be my toggle, but it continue to reset itself to false even after I have set it to true. There is no code in the Page_Load method that sets the IsStartDate = False either, so its not resetting it in the postback. Any ideas? Thanks!!! cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson

    A 1 Reply Last reply
    0
    • C cavall

      I have a public boolean var that is always resetting to false even though I have set it to be true in the final method of the code. I have a calendar object that when the first date is selected it will populate the "startDate" text box with that date, then set the public boolean IsStartDate = True. Upon the next selected date on the calendar the "endDate" text box will be populated with that specific date b/c the IsStartDate boolean var should be set to True now. So... the boolean should be my toggle, but it continue to reset itself to false even after I have set it to true. There is no code in the Page_Load method that sets the IsStartDate = False either, so its not resetting it in the postback. Any ideas? Thanks!!! cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson

      A Offline
      A Offline
      Albert Pascual
      wrote on last edited by
      #2

      Use ViewState to keep the value between postbacks! Al

      C 1 Reply Last reply
      0
      • A Albert Pascual

        Use ViewState to keep the value between postbacks! Al

        C Offline
        C Offline
        cavall
        wrote on last edited by
        #3

        Al, Thanks... it worked like a charm!! ;) Cheers Cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson

        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