ProfileView can now be used for user administration
By far, the most common feature request for my ProfileView control was the ability to edit the profile of any user in the system. Until now, the control could only be used by the current user to edit their own profile. I thought it was a limitation of the Profile provider framework, until I discovered ProfileBase.Create(). I apologize to everyone that has been waiting for this much needed feature for so long.Just set the UserName property on the control to edit a different user. The property is null by default, which loads the current user.
Example usage in a WebForm used to edit a profile:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
string userName = Request.QueryString["username"];
if (!String.IsNullOrEmpty(userName))
{
ProfileView1.UserName = userName;
}
}
}
Download the latest code from the ProfileView project page.
Comments