Hey
ASP.NET 2.0
I'm developing a web portal where users must login to. As far as I know all
users are accessible from the MembershipUserC ollection. I know that current
user is also accessible via the Profile object in the webpage, but I want to
access the properties of one of the other users. So I guess I have to create
an instance of the ProfileCommon class... I have the username of the user I
want to create a ProfileCommon object of, but my problem is that I don't
know how to it....??? 2 1660
You can use this code:
public List<Membership UserWrapperForM PGetMembers(str ing usernameToFind)
{
List<Membership UserWrapperForM PmemberList = new
List<Membership UserWrapperForM P>();
if (usernameToFind != null)
{
MembershipUser mu = Membership.GetU ser(usernameToF ind);
if (mu != null)
{
MembershipUserW rapperForMP md = new
MembershipUserW rapperForMP(mu) ;
ProfileCommon pc =
(ProfileCommon) ProfileBase.Cre ate(mu.UserName , true);
md.FirstName = pc.FirstName;
md.LastName = pc.LastName;
memberList.Add( md);
}
}
return memberList;
}
"Jeff" wrote:
Hey
ASP.NET 2.0
I'm developing a web portal where users must login to. As far as I know all
users are accessible from the MembershipUserC ollection. I know that current
user is also accessible via the Profile object in the webpage, but I want to
access the properties of one of the other users. So I guess I have to create
an instance of the ProfileCommon class... I have the username of the user I
want to create a ProfileCommon object of, but my problem is that I don't
know how to it....???
Thanks for the tip!
This was about getting the profile of a different user, this code get the
profile of a different user:
ProfileCommon userProfile =
(ProfileCommon) System.Web.Prof ile.ProfileBase .Create("userna me", true);
I'm posting this reply in case somebody else came accross the same problem
Thanks for your tip Saeed
"Saeed Kudaimati" <Sa************ @discussions.mi crosoft.comwrot e in
message news:98******** *************** ***********@mic rosoft.com...
You can use this code:
public List<Membership UserWrapperForM PGetMembers(str ing usernameToFind)
{
List<Membership UserWrapperForM PmemberList = new
List<Membership UserWrapperForM P>();
if (usernameToFind != null)
{
MembershipUser mu = Membership.GetU ser(usernameToF ind);
if (mu != null)
{
MembershipUserW rapperForMP md = new
MembershipUserW rapperForMP(mu) ;
ProfileCommon pc =
(ProfileCommon) ProfileBase.Cre ate(mu.UserName , true);
md.FirstName = pc.FirstName;
md.LastName = pc.LastName;
memberList.Add( md);
}
}
return memberList;
}
"Jeff" wrote:
>Hey
ASP.NET 2.0
I'm developing a web portal where users must login to. As far as I know all users are accessible from the MembershipUserC ollection. I know that current user is also accessible via the Profile object in the webpage, but I want to access the properties of one of the other users. So I guess I have to create an instance of the ProfileCommon class... I have the username of the user I want to create a ProfileCommon object of, but my problem is that I don't know how to it....??? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Munsifali Rashid |
last post by:
Hi,
I've built a webservice in C# that can add public folders to Exchange.
There's also a component built in VB6 which references the Outlook 10 (XP)
DLL, so I can change the default form being used to post to a public folder.
The component works fine when instantiated from a Windows script, but when
using it from COM Interop in an ASP.NET web application it errors when
trying to execute oNs.GetNameSpace("MAPI").
The error it throws...
|
by: VB Programmer |
last post by:
I am using personalization/profile to store info for the user that is not
contained in the aspnet_Users or aspnet_Membership tables. This info
includes, firstname, lastname, and phonenumber.
On my "signup" page I ask for all their info at one time, including
username, password, firstname, lastname, etc.... After I do a
Membership.CreateUser and Roles.AddUserToRole I want to store the profile
information. But, the code still thinks...
|
by: Saber |
last post by:
in <system.web> of web.config I've:
<profile>
<properties>
<add name="EnterTime" type="System.DateTime" allowAnonymous="true"/>
</properties>
</profile>
And in Session_Start of global.asax:
|
by: shapper |
last post by:
Hello,
I have a profile with multiple profile properties in my Web.Config:
<add allowAnonymous="false" name="Contact" type="Contact"
serializeAs="Binary"/>
<add allowAnonymous="false" name="Options" type="Options"
serializeAs="Binary"/>
Where each profile property is class, as follows:
|
by: Annie |
last post by:
Hello guys,
I have set the MEMBERSHIP, ROLEMANAGER and PROFILE in my config file as
below.
I just want to use my own sql server 2000 table instead of MSDB.
| |
by: daokfella |
last post by:
I want to be able to store profile information for a user when they
sign up for an account...but BEFORE they can log in. Can this be done
using any of the built-in profile methods?
Here's my current sign-up procedure:
1. User creates an account with username, password, e-mail and other
information that I want to store in profile.
2. User is created as inactive and NOT logged in. Besides the profile
|
by: Rusty Hill |
last post by:
My site does not allow anonymous users. After a user has logged in and been
authenticated I need to access some information in their profile object. I
thought I would do this in the LoggedIn event of the Login object but when
that event fires the user is still not authenticated so the profile is null.
Where and how should I be doing this? Should I be checking the
ProfileModule.MigrateAnonymous Event in the global.asax? Remember I do...
|
by: khairulfnd |
last post by:
i m trying to create a user and add a role to the user and also add its personalization like first name and last name, all at the same time but there is a problem with the personalization.
Since on the point i create the user its anonymous but is there a way to get the user from the database so that when i add the personalization it is not anonymous.
This is my codes in VB
Public Sub CreateUser_OnClick(ByVal sender As Object, ByVal args...
|
by: shapper |
last post by:
Hello,
On my CMS I am signed as administrator and I am creating a Membership
user and its profile:
MembershipCreateStatus status;
MembershipUser user = Membership.CreateUser("Joe", "Pass",
"Joe@email.com", null, null, true, null, out status);
if (user != null) {
ProfileHelper profile =
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |