次の方法で共有


About “CreatedModifiedInfo” web control in SharePoint

In SharePoint custom web application development sometimes we required to fetch the "CreatedBy" and "ModifiedBy" information and show it in the custom page we develops. Instead of writing a SharePoint object model code to fetch the value of "CreatedBy" and "ModifiedBy" information we can make use of an OOB web control which fetches the CreatedBy and ModifiedBy information. We can include this web control in the custom page to show the CreatedBy and ModifiedBy information. In Microsoft.SharePoint.WebControls you can find a control called "CreatedModifiedInfo". This control is used in the various list form template in defaulttemplates.ascx. This control can be used in the custom web pages where you would like to render the "CreatedBy" and "ModifiedBy" information. This is a template control and the template controls for this web control is available in the "DefaultTemplates.ascx" with the ID "CreatedModifiedInfo" and it if versioning is enabled then it takes the "CreatedModifiedVersionInfo" rendering template from defaulttemplates.ascx.

So in the custom web pages where you would like to render the "CreatedBy" and "ModifiedBy" information then you just need to render the "Microsoft.SharePoint.WebControls.CreatedModifiedInfo" web control in the custom web page rather than fetching these information using object model.