Leon:
Your code confuses me slightly. It seems to me you are getting the
user
data from the dataUser.RetrieveAccount function which returns a
DataRow...not sure why you need sessions in this case.
context.Session(Cstr(userRow("FirstName")))
I'm not sure what you are trying to do with the above line, couldn't
you
just do:
myFirstName = cstr(userRow("FirstName")) ??
why do you need sessions at all?
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
So would this work? and how would I access the stored session data
from
within my page?
Imports System.web
' Constructors
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
Public Sub LoadSession(ByVal ChoosenEmailAddress As String)
myEmailAddress = ChoosenEmailAddress
LoadFromEmail()
End Sub
' Private Code
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
Private Sub LoadFromEmail()
Dim dataUser As New Data.Student
Dim userRow As DataRow =
dataUser.RetrieveAccount(myEmailAddress)
Dim context As HttpContext =
System.Web.HttpContext.Current
myFirstName = context.Session(CStr(userRow("FirstName")))
myLastName = context.Session(CStr(userRow("LastName")))
myPassword = context.Session(CStr(userRow("Password")))
myEmailAddress =
context.Session(CStr(userRow("EmailAddress")))
End Sub
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net>
wrote in message Use System.Web.HttpContext.Current.Session ala:
HttpContext context = System.Web.HttpContext.Current;
if (context == null){ //not in a web environment
throw new exception("Function BLAH must be called from within a
web
context");
}
string value = context.Session["blah"];
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
I know that I can access session state on an asp.net page
using Page objects, but how do I access store data in sessionstate
from
the
middle tiers?