'GetProfile' is not a member of Profile.

S

shapper

Hello,

I was using the following line, which was working fine, on an asp.vb
code:

Dim userProfile As ProfileCommon = Profile.GetProfile(username)

Now I moved the code line to a new class under App_Code and I am
getting the error:

'GetProfile' is not a member of Profile.

In my class I have Imports System.Web.Profile

Any idea why I am getting the error?

Thanks,

Miguel
 
G

Gaurav Vaish \(MasterGaurav\)

Dim userProfile As ProfileCommon = Profile.GetProfile(username)
Now I moved the code line to a new class under App_Code and I am
getting the error:

'GetProfile' is not a member of Profile.

Profile is available at two levels:

1. HttpContext::profile is of type System.Web.Profile.ProfileBase
2. YourCustomPage::profile is of type ProfileCommon

The class ProfileCommon is defined nowhere in standard .Net Library.

If you want to use the new GetProfile available in ProfileCommon, do
something like this:

Dim userProfile As ProfileCommon = (ProfileCommon)
ProfileBase.Create(username, isAuthenticated)

since you would be always working with authenticated user, pass True to the
second paramter or use the overloaded method that takes only one paramter,
the username.

Look into the documentation of this method for more details...


HTH.


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

shapper

I am not sure about the authenticated user.
The point is that I am getting all users in a role.
Then I am looping trough each user and get its profile and adding its
data to a datatable.

So you mean I need to authenticate each user?

Thanks,
Miguel
 
G

Gaurav Vaish \(MasterGaurav\)

I am not sure about the authenticated user.
The point is that I am getting all users in a role.
Then I am looping trough each user and get its profile and adding its
data to a datatable.

So you mean I need to authenticate each user?

"Each user" phrase that you are using implies that you are talking about
registered users and unless you authenticated, how do you know who he is?

The user must be authenticated. And then, you can use the API provided
earlier.


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

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,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top