reference profile in class

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
 
M

MasterGaurav \(www.edujini-labs.com\)

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
-----------------------------------------
 
G

Guest

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.
 
G

Guest

then HttpContext.Current.Profile.Item("FullName") =
my_sqldatareader("fullname")
is working, thank you
Is there an easier, short hand, way to reference the items?
 
G

Guest

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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top