'GetProfile' is not a member of Profile.

  • Thread starter Thread starter shapper
  • Start date Start date
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
 
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
-----------------------------------------
 
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
 
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
-----------------------------------------
 
Back
Top