Microsoft Windows SharePoint Services
HomeBackForwardPrint

Show AllShow All

Manage Web Part availability

Manage Web Part availability

Configure options for Web Parts and Web Part Pages

  1. On your server computer, click Start, point to Administrative Tools, and then click SharePoint Central Administration.
  2. On the SharePoint Central Administration page, click Configure virtual server settings.
  3. On the Virtual Server List page, click the virtual server that you want to configure.
  4. On the Virtual Server Settings page, click Manage security settings for Web Part Pages.
  5. Select the options that you want to allow or disallow, and then click OK.

    You can also return to using the default server settings of allowing users to both connect Web Parts and use the Online Web Part gallery, by clicking Restore Defaults.

Configure options for Web Parts and Web Part Pages in the web.config file

There are additional Web Part options you can set in the SharePoint web.config file. The web.config file is a text file containing custom XML elements. You can edit this file using a text editor, such as Microsoft Notepad. By default, the Web.config file is located in the C:\Inetpub\wwwroot\ folder.

The following is a summary of these additional Web Part options and their values.

Safe mode

There are two safe mode attributes.

MaxControls

Specifies the maximum number of server-side controls (HTML Element attribute, runat = "server") on a Web Part Page, including Web Parts, static Web Parts (that is, Web Parts not in a zone) and Web Form Controls. The default value is 50.

CallStack

Shows or hides many (but not all) ASP.NET exceptions that may occur in addition to the initial error reported in the SharePoint Error page. You can do the following:

  • To show these messages, set CallStack to "true".
  • To hide these messages, set CallStack to "false" This is the default.

You might set this attribute to "true" for developers who are testing Web Parts so they can view these messages on a remote computer. You must also set the customErrors mode in the <system.web> section to "On".

Example of setting the safe mode attributes


<SharePoint>
    <SafeMode MaxControls="30" CallStack="True" />
</SharePoint>
<system.web>
    <customErrors mode="On" />
</system.web>

Web Part limits

There are two Web Part limit attributes.

MaxZoneParts

Specifies the total number of Web Parts allowed within all Web Part zones on a Web Part Page.

PropertySize

Specifies the maximum number of bytes used to store Web Part properties on the server.

Example of setting the Web Part limit attributes


<SharePoint>
    <WebPartLimits MaxZoneParts="5" PropertySize="200000" />
</SharePoint>

Web Part cache storage

There is one Web Part cache storage attribute.

WebPartCache Storage

Specifies how a Web Part is cached on the server, if at all. You can enter one of the following values:

ValueDescription
NonePrevent caching Web Parts on the server.
CacheObjectUse ASP.NET web server memory caching. This is the default. In general, this value helps improve performance if your site is installed on a single server.
DatabaseCache Web Parts in site server database. In general, this value helps improve performance if your site is installed on a Web farm.

Example of setting the Web Part cache storage attribute


<SharePoint>
    <WebPartCache Storage="Database" />
</SharePoint>

Web Part work item timeout

There is one value that controls Web Part processes.

WebPartWorkItem Timeout

Specifies a timeout value in milliseconds for any asynchronous child processes started by a Web Part. The default size is 5000.

Example of setting the WebPartWorkItem Timeout value

The following is an example of setting the Web Part work item timeout:


<SharePoint>
    <WebPartWorkItem Timeout value="7000" />
</SharePoint>

Default security policy and trust level

You can conveniently define and specify a default security policy and trust level for all Web Parts installed on the site server using two configuration files. There are two default policies:

WSS_Minimal    A copy of the ASP. NET web_minimaltrust.config file with WebPartPermission.Connections enabled. This is the default.

WSS_Medium    A copy of ASP.NET web_mediumtrust.config file with WebPartPermission.Connectionsand .SharePointPermission.ObjectModel enabled.

Example of defining and setting a minimal trust level


<system.web>
  <securityPolicy>
      <trustLevel name="WSS_Minimal" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\config\wss_minimaltrust.config" /> 
   </securityPolicy>     
   <trust level="WSS_Minimal" originUrl="" />
</system.web>

Example of defining and setting a medium trust level


<system.web>
  <securityPolicy>
      <trustLevel name="WSS_Medium" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\config\wss_mediumtrust.config" /> 
  </securityPolicy>
  <trust level="WSS_Medium" originUrl="" />
</system.web>

Allow access to the online Web Part library from behind a proxy server or firewall

If your server is behind a proxy server or firewall, you must also edit the web.config file for each virtual server for which you want to enable the online Web Part library. In a server farm environment, you must edit this file for each virtual server in every front-end Web server in the server farm.

  1. On your Web front-end server computer, open Notepad, navigate to the folder containing the virtual server for which you want to enable the online Web Part gallery, and then open the web.config file under the following directory:

    \Inetpub\wwwroot

  2. In the web.config file, add the following lines.

    <system.net>
    <defaultProxy>
    <proxy proxyaddress="http://Proxy_Server:port" bypassonlocal = "true"/>
    </defaultProxy>
    </system.net>
    Where Proxy_Server:port is the proxy server or firewall used for your environment.

  3. Save and close the web.config file.
  4. Repeat steps 1 through 3 for each virtual server for which you want to enable access to the online Web Part gallery.

Make a Web Part available in the Web Part Gallery

  1. On a top-level Web site, click Site Settings.
  2. Under Administration, click Go to Site Administration.
  3. Under Site Collection Galleries, click Manage Web Part gallery.
  4. On the Web Part Gallery page, click New Web Part.
  5. Select the check box next to the Web Parts that you want to include in the gallery, and then click Populate Gallery.

Add a Web Part to the Web Part gallery

If you have installed a Web Part Package and need to add the Web Parts to the gallery, use the Upload Web Part button to add the new Web Parts to the gallery.

Caution  Web Parts contain code. Before adding a Web Part to the Web Part Gallery, make sure it is from a trusted source.

  1. On the Web Part Gallery page, click Upload Web Part.
  2. In the Name box, type the name of the Web Part (including the full path to the .dwp file), or click Browse.

    If you have several Web Parts that you want to upload at once, click Upload Multiple Files and select the Web Parts to upload.

  3. In the Group box, select a group, or under Specify your own value:, type a group name for the Web Part.
  4. Click Save and Close.

Add multiple Web Parts to the Web Part gallery

Uploading multple Web Parts to the Web Part gallery requires a Windows SharePoint Services-compatible client program such as Office 2003 installed on the client machine.

Caution  Web Parts contain code. Before adding a Web Part to the Web Part Gallery, make sure it is from a trusted source.

  1. On the Web Part Gallery page, click Upload Web Part.
  2. Under Name, click Upload Multiple.
  3. Select the check boxes next to the Web Parts that you want to upload, and then click Save and Close.

Remove a Web Part from the Web Part Gallery

You can remove a Web Part from the gallery if you want to make it unavailable to users. If a user has already used a Web Part in the site, and you delete the Web Part from the site gallery, the Web Part will remain on the Web Part Page and will still work. However, if an administrator on the server computer removes the Web Part assembly that contains the Web Part from the server, or marks the assembly as unsafe in the Web.config file for the server, the Web Part will no longer run and the user will see an error message.

  1. On the Web Part Gallery page, next to the Web Part that you want to remove, click the Edit icon.
  2. On the Web Part Gallery: Web Part Name page, click Delete.
  3. Click OK to delete the Web Part.

Related Topic

About managing Web Part availability
©2003 Microsoft Corporation. All rights reserved.