ASP 101 - Active Server Pages 101 - Web04
The Place ASP Developers Go!

Please visit our partners

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates

ASP 101 is an site
ASP 101 is an site
Internet News
Small Business
Personal Technology

Corporate Info
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash

 Top ASP 101 Stories Top ASP 101 Stories
An Overview of ASP.NET
Connections, Commands, And Procedures
What is ASP?

Attach Files from Interdev to Email Messages Easily
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates

Quick Tips

Visual Studio Item Templates

When you add a new page to your Web site, do you often find yourself cutting and pasting from another page to get started? If you're spending more time importing controls and setting up content regions for your master page than actually working on the new page, you might want to look into creating an "Item template" in Visual Studio.

Visual Studio makes creating templates amazingly easy. Simply create a new file and set it up exactly as you'd like it to appear when you create a new document from the template. Once you've got the file just how you want it, choose "File -> Export Template..." from Visual Studio's menu. In the dialog box that appears, select "Item template", verify that the current project is selected, and choose the language category in which the template should appear. The next screen is where you select the file you want to export as a template. The third screen lets you select references. In most cases you can ignore these and just click the "Next >" button. On the final screen you'll need to provide a name for the template along with a short description. You'll also notice two checkboxes. The first one tells Visual Studio to automatically import the new template and the second opens a Windows Explorer window to the folder containing the new template.

Once you've completed the wizard, you can give the new template a test by using the "File -> New File..." command. You should see your new tempate under "My Templates" in the "Add New Item" dialog box.

If for any reason things don't work quite right, you can manage templates by adding or deleting them from the location specified in Visual Studio's options screen "Tools -> Options -> Projects and Solutions -> General". It's usually something like C:\Documents and Settings\User Name\My Documents\Visual Studio 2008\Templates\ItemTemplates.

Setting up a template for each of the document types you work with can be a great time saver. Just make sure you give your templates good names and descriptions from the start, otherwise you may find yourself wondering which one is which.

Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to:

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback
The Network for Technology Professionals



Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers