Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

reference profile in class

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Yankee Imperialist Dog - 09 Jul 2007 17:10 GMT
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

Signature

Share The Knowledge. I need all the help I can get and so do you!

MasterGaurav (www.edujini-labs.com) - 09 Jul 2007 18:01 GMT
> 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

Signature

Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-----------------------------------------

Göran Andersson - 09 Jul 2007 20:21 GMT
> 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
[quoted text clipped - 5 lines]
> Thanks!
> KES

Use HttpContext.Current.Profile to reference the profile in the current
context.

Signature

Göran Andersson
_____
http://www.guffa.com

Yankee Imperialist Dog - 09 Jul 2007 20:40 GMT
then HttpContext.Current.Profile.Item("FullName") =
my_sqldatareader("fullname")
is working, thank you
Is there an easier, short hand, way  to reference the items?
Signature

Share The Knowledge. I need all the help I can get and so do you!

> > 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
[quoted text clipped - 8 lines]
> Use HttpContext.Current.Profile to reference the profile in the current
> context.
Göran Andersson - 10 Jul 2007 00:57 GMT
> 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")

Signature

Göran Andersson
_____
http://www.guffa.com


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.