How to use UserProfileView control?

Posted by Community Admin on 03-Aug-2018 11:10

How to use UserProfileView control?

All Replies

Posted by Community Admin on 19-Apr-2011 00:00

Hi there,

I'd like to change the default layout of UserProfileView and use it inside of my custom control. I tried to do this as I did it in Sitefinity 3.7:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="User.aspx.vb" Inherits="User" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Security.Web.UI" TagPrefix="prof" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<head runat="server">
    <form id="form1" runat="server">
            <prof:UserProfileView ID="userProfile" runat="server">
                    <asp:Literal runat="server" ID="FirstName"></asp:Literal>
        <asp:ScriptManager runat="server" ID="ScriptManager1">

Unfortunately, I have got the following error:
Parser Error Message: Telerik.Sitefinity.Web.UI.ContentUI.ViewDefinitionCollection must have items of type 'Telerik.Sitefinity.Web.UI.ContentUI.Contracts.IContentViewDefinition'. 'asp:Literal' is of type 'System.Web.UI.WebControls.Literal'.

Could you please provide an example how to modify the default layout of this control and use custom fields?

Thank in advance,

Posted by Community Admin on 19-Apr-2011 00:00

Hi Anton,

To change the MasterListView template you should have the following declaration in your template.

<%@ Control Language="C#" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Fields" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<telerik:RadListView ID="UserProfilesList" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
        <ul class="sfusersListNameAvatar">
            <asp:PlaceHolder ID="ItemsContainer" runat="server" />
        <li class="sfusersListItem">
            <sf:ImageField ID="predefinedImageField" runat="server" DataFieldType="Telerik.Sitefinity.Model.ContentLinks.ContentLink"
                DisplayMode="Read" ShowDeleteImageButton="false" CssClass="sfusersListAvatar" DefaultSrc="~/SFRes/images/Telerik.Sitefinity.Resources/Images.DefaultPhoto.png" DataFieldName="Avatar" />
            <sf:DetailsViewHyperLink ID="DetailsViewHyperLink1" runat="server" TextDataField="FirstName, LastName" TextDataFormat="0 1" CssClass="sfusersListLnk" />
            <sf:FieldListView ID="DetailsViewText1" runat="server" Text="0" Properties="FirstName" WrapperTagName="" WrapperTagCssClass="" Visible="false" />
            <sf:FieldListView ID="DetailsViewText2" runat="server" Text="0" Properties="LastName" WrapperTagName="" WrapperTagCssClass="" Visible="false" />
<sf:Pager id="pager" runat="server"></sf:Pager>

You should set the public DefaultLayoutTemplatePath property to your customized template.

Best wishes,
Ivan Dimitrov
the Telerik team

Posted by Community Admin on 19-Apr-2011 00:00

Hi Ivan,

Thanks for provided code snippet!

I'm sorry, maybe I asked my question incorrectly, but actually I'm looking for a way to do the following thing.
In Sitefinity 3.7 was a control Telerik.Security.WebControls.ManageProfile that allows displaying custom fields from a user account. There was a very simple way to map the different custom fields. I should only add the needed fields as Literal control something like this:

<prof:ManageProfile ID="userProfile" runat="server" userName="admin">
            <asp:Literal ID="CustomField1" runat="server"></asp:Literal>               
            <asp:Literal ID="CustomField2" runat="server"></asp:Literal>

Is there a way to do the same in Sitefinity 4.1?


Posted by Community Admin on 21-Apr-2011 00:00

Hi Anton,

Currently there is a bug that prevents the fields for editing (, but you can show them using Profile control introduced in Sitefinity 4.1 (Q1) release.

Kind regards,
Ivan Dimitrov
the Telerik team

This thread is closed