View Single Post
  #3 (permalink)  
Old April 30th, 2011, 05:18 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Phil,

Are you sure both code blocks get executed? Your code looks like it should work. What happens when you debug the application? Can you see what exactly s null / Nothing and where?

Also, inside a Page class there's no need to access the HttpContext. Using Session directly should work as well (as it's a property on the Page class):

Code:
Session("Publication") = myPublication
Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote