DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Alan Tong Guest

    Session State Context in ASP.Net


    I have done the following in my VB.Net class supporting my ASP.Net application
    but got a "Object Reference not set to an instance of an object" error, I
    thought I had set it to the current instance of the Context object?! Please
    help!

    Thanks
    Alan...

    Imports System.Web

    Public Class User

    Dim objContext As HttpContext = HttpContext.Current

    Dim intAppID As Integer = objContext.Application("App_ID")
    Dim strSessionID As String = objContext.Session.SessionID

    End Class

  2. #2
    zack Guest

    Re: Session State Context in ASP.Net


    Alan,

    Public Class User
    'Try this!
    Dim objContext As new HttpContext.Current

    Dim intAppID As Integer = objContext.Application("App_ID")
    Dim strSessionID As String = objContext.Session.SessionID

    End Class


  3. #3
    Alan Tong Guest

    Re: Session State Context in ASP.Net


    Thanks. But it didn't work...

    Alan...

    "zack" <zack_attack190@yahoo.com> wrote:
    >
    >Alan,
    >
    >Public Class User
    > 'Try this!
    > Dim objContext As new HttpContext.Current
    >
    > Dim intAppID As Integer = objContext.Application("App_ID")
    > Dim strSessionID As String = objContext.Session.SessionID
    >
    >End Class
    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links