Share via


List Item Form Pages

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The list item form pages (DisplayForm.aspx, EditForm.aspx, and NewForm.aspx) for most Windows SharePoint Services lists are based on the same form.aspx file that is located in Local_Drive:\\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\Pages. This file implements the Windows SharePoint Services default.master file that is located in \12\TEMPLATE\GLOBAL.

By default, list form pages run in no-compile mode for better scalability. Windows SharePoint Services does not allow code on form pages unless allowing code on pages is enabled through the user interface.

List Item Forms and Master Page

Default list form pages are designed according to the default master page, with each area for the control represented by a placeholder on the page. A list form page contains placeholders for the toolbar, header, body, and footer. Each specific form page decides which controls to use in those placeholders, which requires the overall master page design with its nested (derived) master pages.

The master page defines the borders and navigational areas displayed on list item forms. For information about master pages in Windows SharePoint Services, see Master Pages.

The form.aspx file contains a Microsoft.SharePoint.WebPartPages.WebPartZone control that inserts a ListFormWebPart object in the body of the page. To display the contents of the page, this Web Part instantiates a ListForm control whose template is defined in \12\TEMPLATE\CONTROLTEMPLATES\DefaultTemplates.ascx. The ListForm control contains HTML markup and control templates to lay out the toolbar, fields, and other parts of the form. You can specify a custom ListForm control through template properties of the ListFormWebPart class.

Important

Editing the files that Windows SharePoint Services installs on front-end Web servers is not supported. Changes that you make to originally installed files might be overwritten when you install updates or service packs for Windows SharePoint Services, or when you upgrade an installation to the next product version.

Display Form Rendering

Windows SharePoint Services display forms have slightly different rendering than the edit and new forms, because although display forms have the same layout as the edit and new forms and share most controls, display form fields are defined in unmanaged code and have the same field rendering as is used in the list views. In display mode, SharePoint field controls use Collaborative Application Markup Language Core Schemas definitions to render the fields.

Important

Although you can add Web Parts to the Display, Edit, and New forms for list items (DispForm.aspx, EditForm.aspx, and NewForm.aspx), doing so is not recommended or supported in Windows SharePoint Services. Adding Web Parts to list view pages (AllItems.aspx) is supported.

Specifying Custom Pages for Creating or Modifying Lists

You can specify a custom page for creating lists or for editing list properties by specifying the NewPage and EditPage attributes on the ListTemplate element of a list definition Feature.

The folllowing example specifies custom pages for lists created through the list definition.

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListTemplate
    Name="MyTemplate"
    Type="2100"
    BaseType="1"
    OnQuickLaunch="TRUE"
    SecurityBits="11"
    DisplayName="My Custom List Type"
    NewPage="MyCreateList.aspx"
    EditPage="MyEditList.aspx"
    Description="My description..."
    Image="/_layouts/images/itsl.gif"
    DocumentTemplate="100">
  </ListTemplate>
</Elements>