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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. System.Web.HttpContext.Current.Session give Object reference error

System.Web.HttpContext.Current.Session give Object reference error

Scheduled Pinned Locked Moved ASP.NET
help
2 Posts 2 Posters 5 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.
  • N Offline
    N Offline
    N a r e s h P a t e l
    wrote on last edited by
    #1

    Hi, I am using System.Web.HttpContext.Current.Session at my cs file for accessing Session variables like: 1. String CustomerID="0"; 2. if(System.Web.HttpContext.Current.Session["CustID"]!=null) 3. { 4. CustomerID= 5. System.Web.HttpContext.Current.Session["CustID"].ToString(); 6. } 7. ////////// It give an object reference not set to an instatnce of an object- error at line number 2. I have allready assigned the Session["CustID"] at another page.

    N a r e s h P a t e l

    P 1 Reply Last reply
    0
    • N N a r e s h P a t e l

      Hi, I am using System.Web.HttpContext.Current.Session at my cs file for accessing Session variables like: 1. String CustomerID="0"; 2. if(System.Web.HttpContext.Current.Session["CustID"]!=null) 3. { 4. CustomerID= 5. System.Web.HttpContext.Current.Session["CustID"].ToString(); 6. } 7. ////////// It give an object reference not set to an instatnce of an object- error at line number 2. I have allready assigned the Session["CustID"] at another page.

      N a r e s h P a t e l

      P Offline
      P Offline
      Parwej Ahamad
      wrote on last edited by
      #2

      Followup below link that will help you. http://www.odetocode.com/Articles/112.aspx[^]

      Parwej Ahamad R & D: REST services with WCF

      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