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. how to session value in a page.

how to session value in a page.

Scheduled Pinned Locked Moved C#
tutorial
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
    Mubeen asim
    wrote on last edited by
    #1

    helllo.. i have a value stored in a session['foo']="bar"; and as sessions can be accessed in al the pages.. is there any way how to make the sessions inaccisssible in a specific page... ... thanks and regards..

    J 1 Reply Last reply
    0
    • M Mubeen asim

      helllo.. i have a value stored in a session['foo']="bar"; and as sessions can be accessed in al the pages.. is there any way how to make the sessions inaccisssible in a specific page... ... thanks and regards..

      J Offline
      J Offline
      Jens Meyer
      wrote on last edited by
      #2

      May i ask why you want to achieve something like that? Since your Page inherits from base type Page it allways should have access to the Session-Property. One thing you can try is to implement a BasePage-class that inherits from Page. In this class you set the access to Session as a private Member. e.g.:

      private HttpSessionState Session
      {
      get{return base.Session;}
      }

      But i dont know if this will work.

      When in trouble, when in doubt, run in circles, scream and shout

      M 1 Reply Last reply
      0
      • J Jens Meyer

        May i ask why you want to achieve something like that? Since your Page inherits from base type Page it allways should have access to the Session-Property. One thing you can try is to implement a BasePage-class that inherits from Page. In this class you set the access to Session as a private Member. e.g.:

        private HttpSessionState Session
        {
        get{return base.Session;}
        }

        But i dont know if this will work.

        When in trouble, when in doubt, run in circles, scream and shout

        M Offline
        M Offline
        Mubeen asim
        wrote on last edited by
        #3

        actually this was asked to me in an interview.. and my answer was to clear all the session variables on the page_init; he told that is there some kind of markup in the page which does this thing of skipping the session values for a single page... so is there any other way around...

        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