Results 1 to 2 of 2

Thread: Session Issues int asmx services

  1. #1

    Thread Starter
    Fanatic Member vuyiswamb's Avatar
    Join Date
    Jan 2007
    Location
    South Africa
    Posts
    830

    Session Issues int asmx services

    I have a Strange thing happening

    Code:
    <WebMethod(EnableSession:=True)> _
    i have a web method with a

    and the method before it returns something it will call another method Which also has the

    Code:
    <WebMethod(EnableSession:=True)> _
    and another Method on a class will be called and in that method i have something like this


    Code:
    Dim Session As HttpSessionState = HttpContext.Current.Session
    Code:
    Session("usercompany_ID") = drUser("usercomp_id")
    Session("user_id") = drUser("user_id")
    Session("UCLev1_ID") = drUser("UCL1_ID")
    Session("UCLev2_ID") = drUser("UCL2_ID")
    Imidiately when i try to assign the drUser("usercomp_id") to the session to Session("usercompany_ID") i get an Error

    drUser("usercomp_id") has a Value its not nothing

    Error
    Object reference not set to an instance of an object.



    Thanks

  2. #2
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Session Issues int asmx services

    Hello,

    This is most likely due to the fact that Session("usercompany_ID") is null.

    Try using the alternative method:

    http://msdn.microsoft.com/en-us/libr...state.add.aspx

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width