Elizabeth Murray and Jonathan Gordon
Visual Studio Team
Microsoft Corporation
February 2002
Summary: This article provides an in-depth look at the structure of the Microsoft® Visual Studio® .NET Start Page and shows you how to customize the Start Page by adding new content. Four examples are provided, along with the XML used to define the content. In addition, the process for retrieving and displaying information on the Start Page is explained. After reading this article, you will be able to create you own custom content and display it on the Visual Studio Start Page. (23 printed pages)
Contents
Introduction
How the Start Page Works
Adding Customized Content to the Start Page
Examples of Custom Content
Testing and Troubleshooting Start Page Content
Deploying Custom Start Page Content
Conclusion
Introduction
The Visual Studio .NET Start Page is displayed each time you launch the integrated development environment (IDE). The default content provides the latest developer news, helps you create new solutions, and promotes interaction with the online developer community.
To supplement the default content, you can customize the Start Page by adding new content, called tabs. The default content remains; you can add new content but you cannot customize the existing default content. The new content can be either dynamic or static. Dynamic content is updated from a server; static content is stored on the client.
This article provides several examples of how to create new Start Page content and add it to the existing Start Page tabs.
How the Start Page Works
The Start Page is displayed in the Web browser that is available within the IDE. It consists of a client-side .htm page, in this case default.htm, which contains a list of tabs. These tabs are based on locally stored tab definition files that are authored using XML. When you select a tab, Visual Studio reads the related tab definition file for the tab. If a feed is included in the tab definition file, then the content for the tab is downloaded from a server, as specified in the tab definition file. If the file does not contain a feed, static content is displayed as specified in the tab definition file. See Figure 1 below.
.gif)
Figure 1
A client-side schema definition file, vstab.xdr, validates all the content before transforming and rendering it in the Start Page. After the content has been validated, the content is rendered as HTML using a client-side transform, vshome.xsl. If the content fails to pass validation, then the tab does not appear on the Start Page. Each time a tab is rendered, the contents of the tab is cached on your local machine. If the feed for the content is unavailable, you can still view the most recently retrieved content for the tab.
Tab Definition File Format
Custom content for the Start Page is defined in tab definition files that are written using XML. A tab definition file can contain one or more tabs. The XML used to define the custom content must conform to the Start Page XML schema found in vstab.xdr in order to appear on the Start Page.
Note The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, places, or events is intended or should be inferred.
The XML elements and attributes listed below provide the basics for a tab definition file for the Start Page.
<TabDefinition>
<Tab ID="uniquename" Name="displayname">
<Application ID="uniquename">
<PaneSet ID="uniquename">
<Pane ID="uniquename" Title="displayname">
<LinkGroupSet ID="uniquename">
<LinkGroup ID="uniquename" Title="displayname">
</LinkGroupSet>
</Pane>
</PaneSet>
<Data>
<Context>
<Links>
<LItemEx>
<LItem ID="uniquename" LinkGroup="linkgroupid"
URL="urlpath"> displaytext </LItem>
</LItemEx>
</Links>
</Context>
</Data>
</Application>
<Feeds>
<Feed>
<Source LCID="locale" URL="urlpath">
<Arg Name="name"></Arg>
</Source>
</Feed>
</Feeds>
</Tab>
</TabDefinition>
Basic elements and attributes
The following elements and attributes provide the basic framework for the tab definition file.
- <TabDefinition></TabDefinition>
- Required. The root element that contains all of the child elements for the file.
- <Tab></Tab>
- Required. A child element of the <TabDefinition>. At least one <Tab> element is required in a tab definition file. This element takes the attributes ID, Name, and Filterable.
- <Application></Application>
- Required. A child element of the <Tab> element that defines the user interface for the tab. This element takes the ID attribute.
- ID attribute
- Required. A unique ID for the element.
- Name attribute
- Required. The display name for the element.
- Filterable attribute
- Optional. Takes the values True and False. If true, then the Filter drop-down list is displayed and content on the tab is filtered based on the filter you selected. If False, the drop-down is not displayed and content is not filtered.
The following code is an example of a simple tab definition file that contains information for two custom Start Page tabs, Tab1 and Tab2. Tab1 contains filterable, dynamic content while Tab2 contains unfiltered, static content.
<TabDefinition>
<Tab ID="MyTab" Name="Tab1" Filterable="true">
<Application ID="MyApp">
<!--Place UI elements in this section.-->
</Application>
<Feeds>
<!--Place Feed elements in this section-->
</Feeds>
</Tab>
<Tab ID="MyOtherTab" Name="Tab2" Filterable="false">
<Application ID="MyOtherApp">
<!--Place UI elements in this section.-->
<Data>
<---Place Data elements in this section-->
</Data>
</Application>
</Tab>
</TabDefinition>
User Interface Elements
The user interface for custom content is defined within the <Application> element of the tab definition file. Each user interface for a tab is defined using one of the following two elements: <PaneSet> or <Pane>.
- <PaneSet></PaneSet>
- Optional. Defines that content displays on multiple panes within sub-tabs. This element takes the ID attribute. To view a pane set, see Example 2.
For example, the following XML fragment defines multiple panes within sub-tabs:
<Application ID="MyApp">
<PaneSet ID="MyPaneSet">
<Pane ID="MyPane1" Title="My First Pane">
<!--Place UI elements in this section.-->
</Pane>
<Pane ID="MyPane2" Title="My Second Pane">
<!--Place UI elements in this section.-->
</Pane>
</PaneSet>
</Application>
- <Pane></Pane>
- Optional. Defines that content displays in a single pane. This element takes the attributes ID and Title. To view a pane set, see Example 2.
For example, the following XML fragment defines a single pane.
<Application ID="MyOtherApp">
<Pane ID="MyPane1" Title="My First Pane">
<!--Place UI elements in this section.-->
</Pane>
</Application>
Within the <Pane> element, UI elements can be used to display content.
- <Image></Image>
- Optional. Allows a graphic to be displayed on a pane. This element takes the ID, Source, Height, Width, and AltText attributes.
For example:
<Image ID="MyImage" Source="http://www.test-1.msn.com/warning.gif"
Height="40"
Width="40" AltText="My Image" />
- <TextSpan></TextSpan>
- Optional. Displays static text that can be formatted. <TextSpan> can optionally contain the <Break> and <Image> elements. This element takes the ID, FontFamily, and FontSize attributes.
For example, the following XML fragment is a simple text span:
<TextSpan ID="TextSpanSimple">This is a Simple TextSpan</TextSpan>
For example, the following XML fragment is a formatted text span:
<TextSpan ID="TextSpanFormatted" FontFamily="Tahoma" FontSize="14">This
is a TextSpan in Tahoma, 24pt</TextSpan>
For example, the following XML fragment includes <Image> and <Break> elements as part of the <TextSpan> element:
<TextSpan ID="TestTextSpan">
<Image ID="TestSpanImage1" Source=
"http://www.test-1.msn.com/warning.gif"
Height="40" Width="40" AltText="Image 1 Inside Span" />Text for Image 1
inside TextSpan
<Image ID="TestSpanImage2" Source=
"http://www.test-1.msn.com/warning.gif"
Height="40" Width="40" AltText="Image 2 Inside Span" />Text for Image 2
inside TextSpan
<Break/>
<Image ID="TestSpanImage3" Source="http://www.test-1.msn.com/
warning.gif"
Height="40" Width="40" AltText="Image 3 Inside Span" />Text for Image 3
inside TextSpan
</TextSpan>
- <Break></Break>
- Optional. Inserts a line break.
- <HRule></HRule>
- Optional. Displays a horizontal rule.
- <Title></Title>
- Optional. Displays text as bold.
For example:
<Title>This is a title.</Title>
- <Hyperlink></Hyperlink>
- Optional. Displays a hyperlink. This element takes the ID, URL, and Relative attributes.
For example, this XML fragment links to an image on the Web server www.test-1.msn.com:
<Hyperlink ID="TestHyperlink1"
URL="http://www.test-1.msn.com/warning.gif">Hyperlink</Hyperlink>
For example, this XML fragment links to a topic in MSDN help.
<Hyperlink ID="TestHyperlink2" Relative="1"
URL="/ms.msdnvs/vsintro7/HTML/vxoriWhatsNewInVisualStudio.htm">
Hyperlink to Help topic</Hyperlink>
- <LinkGroup></LinkGroup>
- Optional. Defines the placement of a set of LItem elements within a <Pane> element. This element takes the ID and Title attributes.
For example:
<LinkGroup ID="LG1" Title="My LinkGroup" />
<Data>
<Context>
<Attributes>
<!-- Place attributes in this section -->
</Attributes>
<Links>
<LItemEx>
<LItem ID="LI1" LinkGroup="LG1" Image="http://www.test-
1.msn.com/warning.gif">LItem in My Link Group</LItem>
<Blurb>Text describing LItem.</Blurb>
</LItemEx>
</Links>
<Context>
<Data>
- <LinkGroupSet><LinkGroupSet>
- Optional. A set of <LinkGroup> elements.
For example:
<LinkGroupSet>
<LinkGroup ID="LG1" />
<LinkGroup ID="LG2" />
</LinkGroupSet>
- ID attribute
- Required. A unique ID for the element.
- Title attribute
- Required. Display name for the element.
- Source attribute
- Required. A full path or URL for an image.
- Height attribute
- Optional. The vertical size of an image, specified in pixels.
- Width attribute
- Optional. The horizontal size of an image, specified in pixels.
- AltText attribute
- Optional. The text that appears if the image does not display on the pane.
- FontFamily attribute
- Optional. Specifies the font used to display text, such as Tahoma or Verdana.
- FontSize attribute
- Optional. The size of the font, specified in points.
- URL attribute
- Required. An absolute Web URL that must start with http:, https:, news:, ms-help: or vs:.
- Relative attribute
- Optional. Takes the value 1. Use this attribute to point to a URL for a topic included in MSDN help.
Tab Data Elements and Feeds
The <Data> element in the tab definition file contains content for the tab. The <Feed> element allows you to have static content when you are offline but also allows you to point to the server and pass arguments to receive updated content when connected to the Internet.
- <Feeds></Feeds>
- A child element of <Tab> that defines how to download server-side content for a tab.
- <Feed></Feed>
- A child of the Feeds element.
- <Source></Source>
- This element points to content on the server. Takes the LCID and URL attributes.
- <Arg></Arg>
- This element passes additional arguments along with the Feed URL. Takes the Name attribute.
For example:
<Feeds>
<Feed>
<Source LCID="1033" URL="http://myserver/myfeed.aspx">
<Arg Name="feedName">defaultFeed</Arg>
</Source>
</Feed>
</Feeds>
This feed will result in the following URL being called to retrieve content for the tab: <http://myserver/myfeed.aspx?hasArgs=y&feedName="defaultFeed"&FeedLCID=1033&UserLang=en-us>
- <Data></Data>
- Contains static content that is displayed on the tab.
- <Context></Context>
- Used to define groups of <LItem> elements that can be filtered. This element takes the <Attributes> and <Links> elements.
- <Attributes></Attributes>
- Used to specify whether or not content in the <Context> element interacts with pre-defined Help filters. This element takes the <AItem> element.
- <AItem></AItem>
- Used to specify whether or not content in the <Context> element interacts with pre-defined Help filters. This element takes the Name and Value attributes.
- <Links></Links>
- Optional. Parent element for <LItemEx> and <LItem>.
- <LItemEx></LItemEx>
- Optional. A parent element without any attributes that contains the <LItem> and the optional <Blurb> element.
For example:
<LItemEx>
<LItem ID="LI1" LinkGroup="LG1"
Image="http://www.test-1.msn.com/warning.gif">LItem with text and
an image.</LItem>
<Blurb>Text describing LItem.</Blurb>
</LItemEx>
- <LItem></LItem>
- Required. A hyperlink, such as http, https, ms-help, mail, or news, that can include an image. This element takes the ID, LinkGroup, and Image attributes.
- <Blurb></Blurb>
- Optional. Contains static text for the <LItemEx> element.
- ID attribute
- Required. A unique ID for the element.
- LCID attribute
- Optional. The locale ID number for the language to be targeted.
| Language | LCID |
| Traditional Chinese | 1028 |
| German | 1031 |
| English | 1033 |
| French | 1036 |
| Italian | 1040 |
| Japanese | 1041 |
| Korean | 1042 |
| Simplified Chinese | 2052 |
| Spanish | 3082 |
- URL attribute
- Required. An absolute Web URL that must start with http:, https:, news:, ms-help: or vs:.
- Image attribute
- Required. A full path or URL for an image.
- LinkGroup attribute
- Optional. The ID for the <LinkGroup> element that the LItem participates in.
- Name attribute
- Required. The name of a Help attribute category. For more information on Help attributes, see "Creating and Using Filters" in the MSDN Library Help.
- Value attribute
- Required. A Help attribute value.
A <Data> element example:
<Data>
<Context>
<Attributes>
<AItem Name="DocSet" Value="Visual Studio" />
<AItem Name="Product" Value="VS" />
</Attributes>
<Links>
<LItemEx>
<LItem ID="LI1" LinkGroup="LG1" URL="
http://www.test-1.msn.com/warning.gif" Image="
http://www.test-1.msn.com/warning.gif
">This link displays when the Visual Studio filter is applied.</LItem>
<Blurb>Blurb describing Link</Blurb>
</LItemEx>
</Links>
</Context>
</Data>
Adding Customized Content to the Start Page
You can customize the Start Page by adding custom tabs with static or dynamic content. Other types of modifications to the Start Page are possible, but remain unsupported by Microsoft. Some additional information to keep in mind when creating custom content:
- All content must conform to the Start Page schema definition file, vstab.xdr, or the content will not render on the Start Page.
- Rich UI and client-side script are not currently possible for Start Page content. Only a limited set of UI is available, such as links, text, and images.
- You cannot change the order that tabs appear in the Start Page. Default tabs appear first, then custom tabs, and finally the My Profile tab.
- You cannot change the content for any of the default tabs provided with Visual Studio.
Custom Content and Security
Client-side content is as secure as any file that is stored locally on a machine. Content sent from the server as well as content stored on the client is validated to ensure that it conforms to the Start Page schema before it is rendered on the Start Page itself.
Because content on the server is delivered via HTTP, it is recommended that content on the server, prior to delivery to the client, is verified to make sure no malicious content is returned to the client. In Example 4, serverFeed.asp contains ASP code that validates the XML returned by serverFeed.xml:
function replaceBadURLs(xpath, xmlDocument)
{
var i = 0;
var regex = "^http:|^https:|^news:|^ms-help:|^vs:";
var nodes = xmlDocument.selectNodes(xpath);
for(i = 0 ; i < nodes.length ; i++)
{
if(!nodes.item(i).text.match(regex))
{
nodes.item(i).text = "";
}
}
}
Performance Considerations
You should check that the time it takes to render the content of a tab on the Start Page is acceptable. A tab that takes too long to load might cause the user to discontinue using the tab or the Start Page.
Referencing multiple images in a tab definition file, including a large amount of content in the tab definition file, and poor server performance can all contribute to a tab rendering slowly. Always test tab performance before deploying custom tabs to a production environment.
Examples of Custom Content
The following samples are provide to give you ideas about ways in which you can customize the Visual Studio Start Page. Use the Paste as HTML command on the Edit menu when copying and pasting the example code into XML files in Visual Studio. See the section Deploying Custom Start Page Content for information on how to view these samples in the Start Page.
Examples 1, 2, and 3 can be deployed and viewed without making any modifications to the XML provided. Example 4 requires changes in the XML provided here and contains commented instructions on the types of modifications needed for the tab to display.
Example 1: Simple Tab
This example displays a single tab with static hyperlinks. Two of the hyperlinks have descriptive text and graphics associated with them whereas the other two do not.
.gif)
Figure 2. Simple tab
The XML used to create this example is listed below:
<?xml version="1.0" encoding="UTF-8" ?>
<TabDefinition>
<Tab ID="simple_tab" Name="Example 1: Simple Tab" Filterable="false">
<Application ID="Simple_App">
<Pane ID="Main_Pane">
<TextSpan ID="Tab_Description" FontSize="16">Example 1--A
Simple Custom Tab</TextSpan><Break/>
<Break/>
<TextSpan ID="disclaimer">Note: The contents and the code for
this sample tab originated as part of the white paper "Customizing the
Visual Studio Start Page" and are not supported by Microsoft Product
Support Services.</TextSpan>
<Break/>
<HRule/>
<LinkGroupSet>
<LinkGroup ID="WebSites" Title="Hyperlinks with graphics
and text"/>
<LinkGroup ID="SearchEngines" Title="Simple hyperlink
list"/>
</LinkGroupSet>
</Pane>
<Data>
<Context>
<Links>
<LItemEx>
<LItem ID="LI1" LinkGroup="WebSites"
Image="http://www.microsoft.com/library/homepage/images/mslogo-blue.gif"
URL="http://www.microsoft.com">Microsoft</LItem>
<Blurb>Microsoft Home Page</Blurb>
</LItemEx>
<LItemEx>
<LItem ID="LI2" LinkGroup="WebSites"
Image="http://msdn.microsoft.com/library/shared/toolbar/graphics/banners/
MSDN_banner.gif" URL="http://msdn.microsoft.com">MSDN</LItem>
<Blurb>Microsoft Developer Network</Blurb>
</LItemEx>
<LItemEx>
<LItem ID="LI3" LinkGroup="SearchEngines"
URL="http://search.microsoft.com">Search Microsoft</LItem>
</LItemEx>
<LItemEx>
<LItem ID="LI4" LinkGroup="SearchEngines"
URL="http://search.microsoft.com/advanced_search.asp?siteid=us/dev">Search
MSDN</LItem>
</LItemEx>
</Links>
</Context>
</Data>
</Application>
</Tab>
</TabDefinition>
Example 2: Multi-Pane Tab
This example displays a single tab that contains three panes of content: Sites, Search, and Other. Each pane contains hyperlinks.
.gif)
Figure 3. Multi-Paned Custom tab
The XML used to create this example is shown below:
<?xml version="1.0" encoding="UTF-8" ?>
<TabDefinition>
<Tab ID="tabbed_tab" Name="Example 2: Multi-Paned Tab"
Filterable="false">
<Application ID="Tabbed_App">
<PaneSet ID="Main_PaneSet">
<Pane ID="Sites_Pane" Title="Sites">
<TextSpan ID="SitesTab_Description" FontSize="16">Example
2--A Multi-Paned Custom Tab</TextSpan><Break/>
<Break/>
<TextSpan ID="disclaimer">Note: The contents and the code for
this sample tab originated as part of the white paper "Customizing the
Visual Studio Start Page" and are not supported by Microsoft Product
Support Services.</TextSpan>
<Break/>
<LinkGroup ID="WebSites" Title="Hyperlinks with graphics
and text"/>
</Pane>
<Pane ID="Search_Pane" Title="Search">
<TextSpan ID="SearchTab_Description" FontSize="16">Example
2--A Multi-paned custom tab.</TextSpan><Break/>
<LinkGroup ID="SearchEngines" Title="Simple hyperlink
list"/>
</Pane>
<Pane ID="Other_Pane" Title="Other">
<TextSpan ID="Tab_Description" FontSize="16">Example 2--A
Multi-paned custom tab</TextSpan><Break/>
<LinkGroup ID="OtherSites" Title="Simple hyperlink list"/>
</Pane>
</PaneSet>
<Data>
<Context>
<Links>
<LItemEx>
<LItem ID="LI1" LinkGroup="WebSites"
Image="http://www.microsoft.com/library/homepage/images/mslogo-blue.gif"
URL="http://www.microsoft.com">Microsoft</LItem>
<Blurb>Microsoft Home Page</Blurb>
</LItemEx>
<LItemEx>
<LItem ID="LI2" LinkGroup="WebSites"
Image="http://msdn.microsoft.com/library/shared/toolbar/graphics/banners/
MSDN_banner.gif" URL="http://msdn.microsoft.com">MSDN</LItem>
<Blurb>Microsoft Developer Network</Blurb>
</LItemEx>
<LItemEx>
<LItem ID="LI3" LinkGroup="SearchEngines"
URL="http://search.microsoft.com">Search Microsoft</LItem>
</LItemEx>
<LItemEx>
<LItem ID="LI4" LinkGroup="SearchEngines"
URL="http://search.microsoft.com/advanced_search.asp?siteid=us/dev">Search
MSDN</LItem>
</LItemEx>
<LItemEx>
<LItem ID="LI5" LinkGroup="OtherSites"
URL="http://www.gotdotnet.com">GotDotNet</LItem>
</LItemEx>
<LItemEx>
<LItem ID="LI6" LinkGroup="OtherSites"
URL="http://msn.com">MSN</LItem>
</LItemEx>
</Links>
</Context>
</Data>
</Application>
</Tab>
</TabDefinition>
Example 3: Tab with Static Content
This example displays a single tab with static hyperlinks. Two of the hyperlinks have descriptive text and graphics associated with them whereas the other two do not.
.gif)
Figure 4. Tab with static content
The XML used to create this example is shown below:
<?xml version="1.0" encoding="UTF-8" ?>
<TabDefinition>
<Tab ID="static_tab" Name="Example 3: Tab with Static Content"
Filterable="false">
<Application ID="Static_App">
<Pane ID="Main_Pane">
<TextSpan ID="Tab_Description" FontSize="16">Example 3--Tab
with Static Content</TextSpan><Break/>
<Break/>
<TextSpan ID="disclaimer">Note: The contents and the
code for this sample tab originated as part of the white paper
"Customizing the Visual Studio Start Page" and are not supported
by Microsoft Product Support Services.</TextSpan>
<Break/>
<LItemEx>
<LItem ID="LI1" LinkGroup="WebSites"
Image="http://www.microsoft.com/library/homepage/images/
mslogo-blue.gif" URL="http://www.microsoft.com">Microsoft</LItem>
<Blurb>Microsoft Home Page</Blurb>
</LItemEx>
<LItemEx>
<LItem ID="LI2" LinkGroup="WebSites"
Image="http://msdn.microsoft.com/library/shared/toolbar/
graphics/banners/MSDN_banner.gif"
URL="http://msdn.microsoft.com">MSDN</LItem>
<Blurb>Microsoft Developer Network</Blurb>
</LItemEx>
<HRule/>
<LItemEx>
<LItem ID="LI3" LinkGroup="SearchEngines"
URL="http://search.microsoft.com">Search Microsoft</LItem>
</LItemEx>
<LItemEx>
<LItem ID="LI4" LinkGroup="SearchEngines"
URL="http://search.microsoft.com/advanced_search.asp?siteid=us/dev">
Search MSDN</LItem>
</LItemEx>
<HRule/>
</Pane>
</Application>
</Tab>
</TabDefinition>
Example 4: Tab with Live Content
This example displays a single tab with hyperlinks, graphics, and text. The content for the tab is provided by a tab definition file on the server. Content that is meant to be updated from a server has two parts: the client-side tab definition file that contains a pointer to the appropriate server and server-side files that render the XML and check that the XML conforms to the Start Page schema.
.gif)
Figure 5. Tab with Live Content
In order to view this example content, you need to create three files: a tab definition file for the client (example4.xml), a tab definition file for the server (serverFeed.xml), and an .asp feed file for the server (serverFeed.asp) that also validates the XML. In addition, example4.xml needs to be changed to point to the Web server where serverFeed.asp and serverFeed.xml have been saved.
Client-side tab definition file content: example4.xml
This client XML references an .asp file, serverFeed.asp, that must be located on a Web server, referred to in the XML as http://www.test-1.msn.com. If the server is unavailable, the tab displays the text "Unable to load content from the server."
<?xml version="1.0" encoding="UTF-8" ?>
<TabDefinition>
<Tab ID="live_tab" Name="Example 4: Tab with Live Content"
Filterable="true">
<Application ID="Live_App">
<Pane ID="Main_Pane">
<Break/>
<TextSpan ID="Tab_Description">Unable to load content from the
server.</TextSpan>
</Pane>
</Application>
<Feeds>
<Feed>
<!--Replace "http://www.test-1.msn.com/serverFeed.asp" in the
<Source> element below with the path to where the server .asp file is
located.-->
<Source LCID="1033" URL="http://www.test-1.msn.com/
serverFeed.asp">
<Arg Name="feedName">defaultFeed</Arg>
</Source>
</Feed>
</Feeds>
</Tab>
</TabDefinition>
Server-side tab definition file content: serverFeed.xml
This example server XML must be saved in the root directory of the host Web server as serverFeed.xml. When the client tab definition file calls serverFeed.asp, the .asp file points to serverFeed.xml.
<?xml version="1.0" encoding="UTF-8" ?>
<TabDefinition>
<Tab ID="live_tab" Name="Live" Filterable="true">
<Application ID="Live_App">
<Pane ID="Main_Pane">
<Break/>
<TextSpan ID="Tab_Description" FontSize="16"> Example 4--A Tab
with Live Content</TextSpan> <Break/>
<Break/>
<TextSpan ID="disclaimer">Note: The contents and the code for
this sample tab originated as part of the white paper "Customizing the
Visual Studio Start Page" and are not supported by Microsoft Product
Support Services.</TextSpan>
<Break/>
<HRule/>
<LinkGroupSet>
<LinkGroup ID="WebSites" Title="Hyperlinks with graphics
and text"/>
<LinkGroup ID="SearchEngines" Title="Simple hyperlink
list"/>
</LinkGroupSet>
</Pane>
<Data>
<Context>
<Links>
<LItemEx>
<LItem ID="LI1" LinkGroup="WebSites"
Image="http://www.microsoft.com/library/homepage/images/mslogo-blue.gif"
URL="http://www.microsoft.com">Microsoft</LItem>
<Blurb>Microsoft Home Page</Blurb>
</LItemEx>
<LItemEx>
<LItem ID="LI2" LinkGroup="WebSites"
Image="http://msdn.microsoft.com/library/shared/toolbar/graphics/banners/
MSDN_banner.gif" URL="http://msdn.microsoft.com">MSDN</LItem>
<Blurb>Microsoft Developer Network</Blurb>
</LItemEx>
<LItemEx>
<LItem ID="LI3" LinkGroup="SearchEngines"
URL="http://search.microsoft.com">Search Microsoft</LItem>
</LItemEx>
<LItemEx>
<LItem ID="LI4" LinkGroup="SearchEngines"
URL="http://search.microsoft.com/advanced_search.asp?siteid=us/dev">Search
MSDN</LItem>
</LItemEx>
</Links>
</Context>
</Data>
</Application>
</Tab>
</TabDefinition>
Server-side ASP content: serverFeed.asp
The VBScript below directs the Start Page tab to use the file serverFeed.xml for its content. The ASP code ensures that valid XML is returned to the Start Page. This file must be saved in the root directory of the host Web server as serverFeed.asp.
<% @ CODEPAGE="65001" LANGUAGE="VBScript" %>
<% IF (Request.QueryString("feedName") = "defaultFeed") THEN
Response.ContentType = "Text/XML"
Response.Redirect "serverFeed.xml"
END IF
%>
<!--This function ensures that URLs returned to the client are safe for
use with the Start Page.-->
function replaceBadURLs(xpath, xmlDocument)
{
var i = 0;
var regex = "^http:|^https:|^news:|^ms-help:|^vs:";
var nodes = xmlDocument.selectNodes(xpath);
for(i = 0 ; i < nodes.length ; i++)
{
if(!nodes.item(i).text.match(regex))
{
nodes.item(i).text = "";
}
}
}
Testing and Troubleshooting Start Page Content
If customized content does not display as you expected, try the following steps:
- View .xml files in a Web browser to check for parsing errors.
- Check the requirements listed in this paper and then compare the tab definition files against vstab.xdr. If code does not validate against the schema, content does not render.
- Use the Paste as HTML command on the Edit menu when copying and pasting examples from this white paper into .xml files in Visual Studio. If you use the Paste command, the XML designer might add code that does not conform to the Start Page schema.
- Close and then launch Visual Studio again. Tab content that is delivered from a server-side .xml file might not update in the Start Page when you use Refresh.
Deploying Custom Start Page Content
Custom tab content is delivered using tab definition files on the client and the server. Custom tab definition files on the client must be stored in a specific location on your machine for the Start Page to recognize them. URLs in these files can point to content returned from a server.
If content is meant to be updated frequently, a server-side feed should be used. Content on the server can be updated without affecting the client and allows for delivery of content to multiple machines from a single source on a regular basis. The Online Community, Headlines, and Downloads tabs in the Start Page are defined this way. If content is not meant to be updated frequently, or never updated, only a client- side tab definition file is required. The Get Started tab in the Start Page is an example of such a tab.
Tab definition files can be deployed with locale-specific content as well, thereby providing the ability to show custom tabs for multiple languages based on machine regional settings.
When the Start Page is displayed, specific locations are searched on your machine for custom tabs. If tab definition files are found in these locations, content within these files are displayed on the Start Page. When a tab is selected, the client content is rendered. If a server feed is defined, the server content is then downloaded, replacing content from the client, and displayed within the Start Page.
To deploy custom tabs on the client
- Browse to the <Visual Studio install path>\Common7\IDE\HTML\Custom\ directory. If the Custom directory does not exist, create it.
- Copy the tab definition files, *.xml, into the directory.
- Launch Visual Studio .NET and view the Start Page. Custom tabs appear near the bottom of the tab list.
If you cannot see your custom tabs, you might have errors in your XML. See the section Testing and Troubleshooting Start Page Content Issues for more information.
To deploy locale-specific custom tabs on the client
- Browse to the <Visual Studio install path>\Common7\IDE\HTML\<Locale ID>\Custom\ directory. If \...\<Locale ID>\Custom\ does not exist, create the directory.
For example: c:\Program Files\Visual Studio .NET\Common7\IDE\HTML\1033\Custom\ for English.
| Language | Locale ID |
| Traditional Chinese | 1028 |
| German | 1031 |
| English | 1033 |
| French | 1036 |
| Italian | 1040 |
| Japanese | 1041 |
| Korean | 1042 |
| Simplified Chinese | 2052 |
| Spanish | 3082 |
- Copy the tab definition files, *.xml, into the appropriate locale directories.
Content that is meant to be updated from a server has two parts: the client-side tab definition file that contains a pointer to the appropriate server and server-side files that render the XML and check that the XML conforms to the Start Page schema. These files can be anything from a simple XML file deployed to a Web server to a complete .NET application or even an XML Web Service on a server that returns XML. For example, you can use an .asp file that points to an XML tab definition file, as in Example 4.
To deploy dynamic content on the server
- Include a pointer in the <Feed> section of the client tab definition file that references the server, application path, or output file.
- Browse to the <Visual Studio install path>\Common7\IDE\HTML\Custom\ directory. If the Custom directory does not exist, create it.
- Copy the tab definition files, *.xml into the directory.
- On the server, make sure that the server-side files are in place.
Conclusion
As this paper has illustrated, you can easily add custom content to the Visual Studio Start Page and deploy that content to multiple machines. The content can be static, or you can choose to provide changing content by hosting files on a server. Whichever method you choose, customizing the Start Page is a way to adapt the IDE to your needs or the needs of your organization.
For more information, see the topic "Start Page" in MSDN.