ProfileView
ProfileView
This is the official home of my new ProfileView control. ProfileView is an ASP.NET 2.0 server control that enables your users to view and/or edit their Personalization Profile. Read my original post about it for more background.
Download
The source code is now freely available! Download it and do with it as you wish. If you add any features, I would appreciate it if let me know about it using the contact information on my blog.
How to use
Register the assembly at the top of the aspx page that will host the control:
<%@ Register Assembly="FlimFlan.WebControls" Namespace="FlimFlan.WebControls" TagPrefix="flim" %>
Place the control markup where you want the ProfileView to appear:
<flim:ProfileView ID="UserProfile" runat="server" />
History
June 24, 2006: Release 1.2.524.2006
- Added the UserName property to allow you to edit the profile of any user in the system - not just the current user.
January 8, 2006: Release 1.1.108.2006
- Properties now display in the order they are listed in web.config
- Design-time view now uses same rendering method as runtime
- Fixed design-time bug that caused it to fail when a profile property type was not specified
- Design-time view now has a Smart Tag to allow you to preview an anonymous user's profile
October 30, 2005: Updated for the final release (RTM) version of Visual Studio 2005 / .NET Framework 2.0
July 7, 2004: A significantly updated version is now available.
- The design-time view now shows your actual profile properties, instead of sample properties
- New ReadOnly mode allows you to use ProfileView to display a user's profile, without allowing them to edit it.
- Now supports profile groups
TODO:
- Add the ability to disable display of profile properties by their “group“
- Create a templated UI (or at least more style/formatting properties)
- Allow better support for display of custom types/collections
Comments
1) Create your own profile provider - you can make it do whatever you want. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/ASPNETProvMod_Prt5.asp
2) Modify the stored procedure created by the SqlRoleProvider. It looks like the one you want to modify is called aspnet_Profile_GetProperties (in your provider database - aspnetdb by default). The last statement in that procedure updates the LastActivityDate. Remove it (or comment it out).
I'm trying to download the newest release, but the .zip contain an older version: 1.0.1030.2005
I realy need the new features :)
One more thing.
How can I use this control in an admin page? I want my site admins to be able to change the users profile info.
You've stumbled upon something strange. When I download the release using Firefox, I *also* get the old version. I have checked and re-checked, uploading the new version many times, and I still get the old version. I then tried using IE, and it downloaded the correct new version. I have no idea why at this point, but its something to try.
Sorry, you cannot use it in an admin page to manage other user's profiles. My control is built on Microsoft's Profile Provider framework, and that framework wasn't designed for the use case of manipulating other people's profiles.
I am still learning asp.net and I am haour instruction having trouble implementing the profileView. Can you give me more detail about how to use it. I followed your instruction above but I got the following error message in the control: "error creatin control- conent1 unknow server tag 'flim:profileView' "
As a learning project, I trying to create a dating website where user will create their profile and a profile of their match. So all site visitors will be able to search for soulmate base on location, gender, age, sexual orientation, ect....
What is the best way to implement such a project?
Thank for your help and caoching!
Moussa
There is now a lot of documentation (including full source code of the Microsoft providers) on how to create your own provider. Check out Scott Guthrie's post:
http://weblogs.asp.net/scottgu/archive/2006/04/13/442772.aspx
I have heard great things about ProfileView, but I am new to Visual Studio and I'm not sure how to use the source code. Could you give me just a brief explanation about how to implement it? Many thanks in advance.
Fred
I really appreciate you great help if you could kindly have a look at the below scenario and provide your feed back. thankyou.
I have a web site in which, I would like to create or have a table (with add/remove option)in each/every profile, & one column of that table should be dropdown (where he should be able to select the server name)& rest of the columns he can able to write/fill.
please do kinldy help me. Thanks again,
i am doing project in asp dot net. i had a doubt that is how to set they dropdownlist size when you add more items
i was add 100 items if i click the dropdownlist the size is increase. i want display 10 items, other items view through scrollbar
reply me
Anyway, I was trying to play with the source code but it does not open with VS.2003 and also not with C# Express 2005
C# Express does not support class libraries, so it will not work either. You need a full version of Visual Studio 2005. You could probably also use MSBuild.exe, CSC.exe, or SharpDevelop to compile the code.
The problem I found using it in an admin page is that when you change the name of the user nothing happens. Further investigation revealed that when the Username property of the control is set it only updates the private member field but it does not bother to update the controls with the values of the properties of the selected user :O
Haven't yet figured out how to get it done without breaking the rest.
When you call GetProfile, there is a second param (bool) you can set that will force it to NOT update.
I want to use your control but have only one isue with it and do not have enough knowledge to modify your source code.
My Problem as follows:
I have Profile Properties defined in web.config as below - :
<add name="Country" type="string"/>
<add name="Gender" type="string"/>
<add name="Age" type="Int32"/>
<add name="DateOfBirth" type="DateTime"/>
When viewing the page containing your control thru the browser, only the COUNTRY and GENDER properties is available to be edited. Is there any reaon why the other two is not available. Might it have something to do with their TYPE?
Thanks in advance.
Cheers,
Johan
Thanks for your quick response. That did the trick. Is there any easy way of setting the properties for the individual fields, i.e. width of textboxes, validation etc.
Cheers,
Johan
It would seem very common to be able to set a "display name" for profile properties. Is there any easy way to do this?
For example I might have a property called SpecialOffer, and the code should use that name, yet the HTML display might be "Free ECards".
Otherwise the UI could not be changed independent of the code, right?
Any feedback appreciated -
LTG
i downloaded the .zip file.
But i could not find .aspx file on it.
how do i make this application run?
thanks.
So, what is the final solution to avoid updates of the last activity date? My code looks like this:
private MembershipUserCollection GetSiteUsers()
{
MembershipUserCollection siteMembers = new MembershipUserCollection();
MembershipUserCollection Members = Membership.GetAllUsers();
foreach (MembershipUser CurrUser in Members)
{
if (Profile.GetProfile(CurrUser.UserName).SiteID == Profile.SiteID &&
!Roles.IsUserInRole(CurrUser.UserName, "MasterAdmin"))
{
siteMembers.Add(CurrUser);
}
}
return siteMembers;
}
(http://www.asp.net/downloads/sandbox/table-profile-provider-samples/)
this control was very helpful. I have one issue, once the form is working and a user fills it out, how do you get it to move to a new page. Is there a way to make this another step in the create account wizard?
Thanks,
Doug