473,396 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

reference profile in class

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

--
Share The Knowledge. I need all the help I can get and so do you!
Jul 9 '07 #1
4 1528
Yankee Imperialist Dog wrote:
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öran Andersson
_____
http://www.guffa.com
Jul 9 '07 #2
then HttpContext.Current.Profile.Item("FullName") =
my_sqldatareader("fullname")
is working, thank you
Is there an easier, short hand, way to reference the items?
--
Share The Knowledge. I need all the help I can get and so do you!
"Göran Andersson" wrote:
Yankee Imperialist Dog wrote:
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öran Andersson
_____
http://www.guffa.com
Jul 9 '07 #3
Yankee Imperialist Dog wrote:
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")

--
Göran Andersson
_____
http://www.guffa.com
Jul 10 '07 #4
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
-----------------------------------------
Jul 10 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: | last post by:
Hi all, How can I get a reference to my custom profile provider in my .aspx page? I have looked at httpcontext.current.profile. But from there where do I go? Ideally I would like to be able to...
6
by: Shimon Sim | last post by:
Hi I am working on application that need to hold custom user information - Last and first name, email, some other domain related information. I used to create Base class for all my pages. The base...
6
by: liu | last post by:
Hi all, in my vb.net solution, i have 3 project: 1. Main-this is the startup or the base of my window application. 2. Sales-this is the project that contains all the sales info 3. Product-this...
1
by: shapper | last post by:
Hello, I have the following class to be used in profile: <Serializable()_ Public Class Options Inherits ProfileBase Private _Newsletter As Boolean Public Property Newsletter() As Boolean
9
by: Kirk | last post by:
I have successfully, implemented a custom Membership Provider to a SQL 2000 table, however, I am having problems doing the same with a Profile Provider. As I understand it, the steps for both of...
3
by: shapper | last post by:
Hello, In my Page's VB.NET code I am changing the value of the Profile property NAME. Profile.Name = tbName.Text However, I need to change this property value from a class in my App_Code...
3
by: Oriane | last post by:
Hi there, I would like to open my Asp.Net project as a "Web Application" rather than as a "Web Site" in Visual Studio. But the thing is that I use the System.Web.Profile and the auto-generated...
5
by: Steven | last post by:
I have the following in my web.config: <system.web> <profile defaultProvider="MyASPSqlProfileProvider" enabled="true" > <properties> <add name="FirstName" defaultValue="" type="string"/> <add...
3
by: shapper | last post by:
Hello, I have the following loop and error message: foreach (Theme theme in Profile.Collaborator.Themes) { ... And I get the following error: Object reference not set to an instance of an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.