473,386 Members | 1,790 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,386 software developers and data experts.

'GetProfile' is not a member of Profile.

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

Jan 25 '07 #1
3 7117
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
-----------------------------------------
Jan 25 '07 #2
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

On Jan 25, 5:43 pm, "Gaurav Vaish \(MasterGaurav\)"
<gaurav.vaish.nos...@nospam.gmail.comwrote:
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 |http://www.mastergaurav.comwww.eduji...jinionline.com
-----------------------------------------
Jan 25 '07 #3
>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
-----------------------------------------
Jan 26 '07 #4

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

Similar topics

4
by: 0to60 | last post by:
I don't know if I have that terminology right, but does anyone know if static member functions (or free standing functions for that matter) are any less overhead than actual member functions that...
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...
3
by: Wayne Brantley | last post by:
VS2005 RTM Create a web user control to use as a base class for other web user controls. Now, create a new web user control, change the class it inherits from to your base class and compile....
0
by: Giorgio | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older...
6
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a...
5
by: mast2as | last post by:
Hi guys Here's the class I try to compile (see below). By itself when I have a test.cc file for example that creates an object which is an instance of the class SpectralProfile, it compiles...
27
by: milestogofromhere | last post by:
I am new to OO PHP and this is probably something really stupid, I have the following code in redirect.php: <?php include("include_functions.php"); include("classes.xhtml.php");...
4
by: Scott M. | last post by:
When profile data is stored in ASP .NET, where is the user data persisted? For how long is it persisted: is it session persisted or permanent (like a cookie)?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.