reference profile in class

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm attempting to reference a profile item i set in a class
for some reason profile.myitem will be seen in a code file for a page, but
not in the class. Anyone know how to reference items in a class?

In this case: Profile.FirstName = "myName" is ok in xxx.aspx, but not in
myClass.vb

Thanks!
KES
 
I'm attempting to reference a profile item i set in a class
for some reason profile.myitem will be seen in a code file for a page, but
not in the class. Anyone know how to reference items in a class?

In this case: Profile.FirstName = "myName" is ok in xxx.aspx, but not in
myClass.vb

The solution is available here:
http://faqs.edujini-labs.com/5_1_en.html


--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-----------------------------------------
 
Yankee said:
I'm attempting to reference a profile item i set in a class
for some reason profile.myitem will be seen in a code file for a page, but
not in the class. Anyone know how to reference items in a class?

In this case: Profile.FirstName = "myName" is ok in xxx.aspx, but not in
myClass.vb

Thanks!
KES

Use HttpContext.Current.Profile to reference the profile in the current
context.
 
then HttpContext.Current.Profile.Item("FullName") =
my_sqldatareader("fullname")
is working, thank you
Is there an easier, short hand, way to reference the items?
 
Yankee said:
then HttpContext.Current.Profile.Item("FullName") =
my_sqldatareader("fullname")
is working, thank you
Is there an easier, short hand, way to reference the items?

You can make a reference to the profile:

Dim p As ProfileBase = HttpContext.Current.Profile

Then use the reference to access the profile:

p.Item("FullName") = my_sqldatareader("fullname")
 
Back
Top