General Methodology

The following methodology is recommended when creating Web Parts:

  • Always use relative URLs in your HTML, ASP, and VBScript files.
  • Generate relative links for any links within your Web Part. If you code the absolute URL in the Web Part or in the creation of the Web Part to a network basic input/output system (NetBIOS) name, your Web Part works only for NetBIOS. URLs that are coded to a NetBIOS name will not work on a computer running Microsoft SharePoint Portal Server 2001 deployed across an internal or external fully qualified domain name (FQDN). Using relative links enables you to use the same Web Part for NetBIOS, internal FQDN, and external FQDN.

To use relative links when creating a new Web Part:

  1. On the Settings page of a Web Part, select the Get content from the following link check box.

    If you are editing an existing Web Part, click Show Advanced Settings to see this check box.

  2. Type the URL for the link to the content.

In addition, you can convert the ASP or HTML code to a Web Part. For more information and sample code, see the Sample Codes section in this chapter.

To avoid poor and interrupted server performance do not use a stand-alone ASP page as a Web Part.

The threads available for ASPs are computed by adding one to the number of processors. For example, two threads are available on a single processor computer, and three threads are available on a dual processor computer. If you do use a stand-alone ASP page as a Web Part, run it in isolated mode. In this case, there is no increased risk of hangs due to a deadlock.

If you use an ASP page as a Web Part and it is not running in isolated mode, it is recommended that you use an ASP page that generates an HTML fragment and not a full page.

A fragment includes only the code that is required to draw the Web Part. It does not include extraneous tags (such as <HTML> </HTML> or <BODY> </BODY>) that may be inserted by your editing application.

If you use an ASP page as a Web Part and it is running in isolated mode, it is recommended that the ASP page generate a full HTML page.

  • Use Visual Basic scripted files as Web Parts. Using Visual Basic scripted files reduces the load on the server, resulting in increased performance.
  • Include copious error handling in the code for Web Parts. Web Parts are difficult to debug once they are in the dashboard framework.


Microsoft Sharepoint Portal Server 2001 Resource Kit
Microsoft SharePoint(TM) Portal Server 2001 Resource Kit (Examples & Explanations Series)
ISBN: 0735615624
EAN: 2147483647
Year: 2001
Pages: 231

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net