How It Works
When you export the template, Visual Studio creates a zip file with the necessary files an ASPX fi le
and a Code Behind fi le in this exercise. This zip fi le is then stored in the ItemTemplates subfolder
of the Visual Studio 2012 folder under your Documents folder. Some of the fi les in the zip fi le contain
the placeholders $relurlnamespace$ and $safeitemname$. When you add a new fi le to the site
that is based on your template using the Add New Item dialog box, VS replaces $relurlnamespace$
with the name of the folder (nothing, in the case of a fi le added to the root of the site) and $safeitemname$
with the actual name of the page. In this exercise, you typed TestPage.aspx as the new name
for the page, so you ended up with a class in the Code Behind called _TestPage, which in turn inherits
from the global BasePage. The underscore (_) is hard-coded between the two placeholders and is really
only needed when adding a Web Form based on this template to a subfolder. However, it’s a valid start
of a class identifi er so you can safely leave it in for pages at the root of your website. If you add a fi le to
a subfolder, such as the Demos folder, the class name is prefi xed with the name of the folder so you end
up with a class called Demos_TestPage. In addition to $relurlnamespace$ and $safeitemname$, you
can use a few other placeholders. Search the MSDN site at http://msdn.microsoft.com for the term
$safeitemname$ to fi nd the other template parameters.
If you need to make a change to the exported template, either redo the entire export process, or manually
edit the fi les in the zip fi le.