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. confused on property

confused on property

Scheduled Pinned Locked Moved ASP.NET
helpquestion
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.
  • M Offline
    M Offline
    MeterMan
    wrote on last edited by
    #1

    How do you go about doing something like this? i want to keep a record of the current page number i know i could use a session but I wanted to try the property method as a different way. Here is what I have came up with Pageload() if NOT ispostback() pagenumber =1 end if Public Property pagenumber() Get Return value ' not sure what to put here if i need to declare an integer or what? End Get Set(ByVal value) dim myvalue = value ' confused on this if thats what i need to do? or not. End Set End Property thanks for the help just confused on this one. couldn't find an answer on google but probably not looking in the right place :( MeterMan "Live life to its fullest because, you never know when it will be taken away."

    M 1 Reply Last reply
    0
    • M MeterMan

      How do you go about doing something like this? i want to keep a record of the current page number i know i could use a session but I wanted to try the property method as a different way. Here is what I have came up with Pageload() if NOT ispostback() pagenumber =1 end if Public Property pagenumber() Get Return value ' not sure what to put here if i need to declare an integer or what? End Get Set(ByVal value) dim myvalue = value ' confused on this if thats what i need to do? or not. End Set End Property thanks for the help just confused on this one. couldn't find an answer on google but probably not looking in the right place :( MeterMan "Live life to its fullest because, you never know when it will be taken away."

      M Offline
      M Offline
      MeterMan
      wrote on last edited by
      #2

      Here is what I have came up with but for some reason the code doesn't hold the current pagenumber it resets it every time to 1 according to debugger. I have it is not ispostback so this has me puzzled. Please look at code and advise thanks :) http://pastebin.com/662278 thanks alot MeterMan "Live life to its fullest because, you never know when it will be taken away."

      G 1 Reply Last reply
      0
      • M MeterMan

        Here is what I have came up with but for some reason the code doesn't hold the current pagenumber it resets it every time to 1 according to debugger. I have it is not ispostback so this has me puzzled. Please look at code and advise thanks :) http://pastebin.com/662278 thanks alot MeterMan "Live life to its fullest because, you never know when it will be taken away."

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

        The value is not reset, it simply doesn't exist from one request to the next. For each request a new Page object is created, it isn't preserved from one request to the next. --- b { font-weight: normal; }

        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