Partager via


WebpageControlOptions XML Elements Reference

You can display content defined for a Web page or within a CDATA tag on a work item form by using the WebpageControlOptions element. You can include either the Link or the Content child elements to specify either a URL or HTML for the content to appear in the form.

To add elements to a form, you modify a work item type. See Modify or add a custom work item type (WIT).

The WebpageControlOptions element is a child element of the CONTROL element.

Schema Hierarchy

WITD

   WORKITEMTYPE

       FORM

           Layout

               Group

               Column

               TabGroup

                  Tab

                     Control

<WebpageControlOptions AllowScript="true | false" ReloadOnParamChange="true | false" >
   <Link UrlRoot="UrlRoot" UrlPath="UrlPathWithParameters">
      <Param Index="IndexValue " Value="Param Value " Type="Original | Current" />
   </Link>
   <Content>
      <![CDATA[Contents of HTML]]>
   </Content>
</WebpageControlOptions>

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Child Elements and Attributes

Element

Attribute

Description

WebpageControlOptions

 

Optional Control element when type="WebpageControl".

Container element for defining a URL whose contents will be rendered in the work item form.

Optional Link element. Required when UrlPath is specified.

Specifies a value to be used to determine the URL of the hyperlink when UrlPath is specified.

The element type is complex type: WebpageControlOptionsType.

 

AllowScript

Optional WebpageControlOptions attribute.

Specifies whether JavaScript within the Web page is allowed to run (true) or not (false). The attribute type is xs:boolean.

All other settings such as ActiveX are based on the Internet Explorer settings defined for the client.

 

ReloadOnParamChange

Optional WebpageControlOptions attribute.

Specifies whether to reload (true) the contents of the Web page when a parameter in the work item form is changed (true) or not (false). The attribute type is xs:boolean.

The default value is true.

Link

 

Optional WebpageControlOptions element. This element is mutually exclusive with the Content element.

Specifies the URL for the Web page to be rendered in the work item form.

For more information, see Link and Param XML Elements Reference.

Content

 

Optional WebpageControlOptions element.

This element is mutually exclusive with the Link element.

Specifies the HTML content that is to be rendered by the Web page control. The content is specified within a CDATA tag. For example:

<![CDATA[Click here for detailed <b><a href="http://www.microsoft.com">Process Guidance</a></b>]]>

The element type is xs:string.

Note

The HTML content is not validated prior to rendering it in the work item form.

Parent Elements

Element

Description

Control

Required parent element. Defines a field, text, hyperlink, or other control element to appear on the work item form.

Text

Optional LabelText element.

Container element for the information or label to appear on the work item form.

For more information, see LabelText and Text XML Elements Reference.

Remarks

The Link and Content elements are mutually exclusive.

The AllowScript and ReloadOnParamChange attributes are not allowed when you use the Content element.

When the Web page control is configured to display raw HTML, all scripting is disabled. Any hyperlinks in the content that are clicked are opened in the Visual Studio Web browser if the work item form is shown in Visual Studio or in Internet Explorer.

Several toolbar buttons are added to the work item form for a tab that contains WebpageControl. These options include the following functions:

  • Back and forward navigation

  • Stop content loading and refresh content

  • Return to content home page

  • Open the content in a new window or in an external browser

In addition, if the Web page to be loaded contains untrusted content, then the icon is blocked and the blocked icon appears.

The WebpageControlOptions element is only recognized by clients that are running the latest version of Team Explorer. For previous versions, a red area is displayed and a message appears indicating that the control could not be found. For more information, see Provide help text, hyperlinks, or web content on a work item form.

Example

The following example shows how to load a work item form with HTML defined in a CDATA tag.

<Control Type="WebpageControl">
   <WebpageControlOptions>
      <Content>
         <![CDATA[Click here for detailed <b><a href="https://www.microsoft.com">Process Guidance</a></b>]]>
      </Content>
   </WebpageControlOptions>
</Control>

Schema Definitions

WebpageControlOptionsType

<xs:complexType name="WebpageControlOptionsType">
   <xs:choice minOccurs="1" maxOccurs="1">
      <xs:element name="Link" type="HyperLinkType"/>
      <xs:element name="Content" type="xs:string"/>
   </xs:choice>
      <xs:attribute name="AllowScript" type="xs:boolean" use="optional" />
      <xs:attribute name="ReloadOnParamChange" type="xs:boolean" use="optional" />
</xs:complexType>

NonBlankString

<xs:simpleType name="NonBlankString">
   <xs:restriction  base="xs:string">
   <xs:pattern value=".*\S+.*"/>
   </xs:restriction>
</xs:simpleType>

Element Information

Namespace

https://schemas.microsoft.com/VisualStudio/2008/workitemtracking/typedef

Schema Name

Work Item Type Definition

Validation File

WorkItemTypeDefinition.xsd

Element Type

WebpageControlOptionsType

Can Be Empty

Not applicable

See Also

Concepts

Specify work item form controls

Design the work item form

Other Resources

Provide help text, hyperlinks, or web content on a work item form