I would like to customize sharepoint form component "id=UserListForm" on userdisp.aspx/useredit.aspx (WSS 3.0) to achieve the following goal. Can anyone give me advise how to do it Thanks in advance.
|
SharePoint - General Question and Answers and Discussion
I would like to customize sharepoint form component "id=UserListForm" on userdisp.aspx/useredit.aspx (WSS 3.0) to achieve the following goal. Can anyone give me advise how to do it Thanks in advance.
|
Which ControlTemplate (ascx) contains the UserListForm
I want to remove the account id for privacy reasons.
I'd be interested in seeing a solution as well.
http://tech.groups.yahoo.com/group/sharepointdiscussions/message/22727
Contains more questions than answers, but maybe you can take it from there and help me out!
Got it! I was trying to remove the AccountID from the userdisp page
I created a User Control in ~/_controltemplates/BYUIUserListForm.ascx
I registered components for this new user control
<%@ Control Language="C#" AutoEventWireup="false" %>
<%
@Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %><%
@Register TagPrefix="SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.WebControls"%><%
@Register TagPrefix="SPHttpUtility" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.Utilities"%><%
@ Register TagPrefix="wssuc" TagName="ToolBar" src="~/_controltemplates/ToolBar.ascx" %><%
@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="~/_controltemplates/ToolBarButton.ascx" %>
I found the RenderingTemplate UserListForm in DefaultTemplates.aspx and copied it to my BYUIUserListForm.ascx
<
SharePoint:RenderingTemplate ID="UserListForm" runat="server"> <Template>....
</Template>
</SharePoint:RenderingTemplate>
I changed the name of the template from
<SharePoint:RenderingTemplate ID="UserListForm" runat="server">
to
<SharePoint:RenderingTemplate ID="BYUIUserListForm" runat="server">
I Changed the line
<SharePoint:ListFieldIterator runat="server"/>
to
<SharePoint:ListFieldIterator TemplateName="BYUIListFieldIterator" ExcludeFields="Name" runat="server"/>
and added my own FieldIterator template "BYUIListFieldIterator"
But the default RenderingTemplate will be sufficient for most:
<SharePoint:ListFieldIterator ExcludeFields="Name" runat="server"/>
I copied ~/_layouts/userdisp.aspx to ~/_layouts/CustomUserDisp.aspx
and added the line
<%@ Register TagPrefix="me" TagName="custom" src="~/_controltemplates/BYUIUserListForm.ascx" %>
I changed the FormComponent template to use my new control template:
<SharePoint:FormComponent id="UserListForm" TemplateName="BYUIUserListForm" ControlMode="Display" runat="server"/>
The title also contains two controls which display accountid so I set visible="false"
Recycling the app pool didn't do the trick so I did an iisreset and that's it.