944,027 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 4431
  • ASP.NET RSS
Mar 28th, 2006
0

calling session variable

Expand Post »
when i call the session variable on pageload the following error occur

System.NullReferenceException: Object reference not set to an instance of an object.


the code was

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

religion.SelectedItem.Text = CStr(Session("name"))

Session.Remove("name")
end sub
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vaisakh is offline Offline
11 posts
since Mar 2006
Mar 29th, 2006
0

Re: calling session variable

in the Global.asax file at the Session_Start event, initialize your session variable with any value then you can use it latter on your code.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SergioGP is offline Offline
8 posts
since Mar 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Restore the properties of dynamic controls during postbacks
Next Thread in ASP.NET Forum Timeline: calling functions





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC