ASP Code
  Home arrow ASP Code arrow Add Your Own HTML template to the
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP CODE

Add Your Own HTML template to the
By: aspfree
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 23
    2001-11-17

    Table of Contents:

    Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Add Your Own HTML template to the "Add New Items"
    list in VS.NET by Curtis Swartzentruber

    If you are like me, you tend to just jump into the Visual Studio IDE and get to work. However, there is a lot of customization you can do to improve your productivity. For example, large project teams can use Enterprise Templates to enforce coding standards, layouts, and guidelines across a project or organization.

    I just wanted to do something simple though. When you are working in Visual Studio, you can use the "Add New Item" functionality to add a file of a certain type to your project, such as a blank HTML page, aspx page, or vb class file. No big news there. When adding an HTML page, I wanted the option of using my own template rather than the default. There are basically 2 ways to do this, change the default template VS.NET uses or create your own template.

    The templates that VS.NET uses for VB.NET are located in your "Microsoft Visual Studio.NET" directory, typically in "Program Files." on whatever drive you installed VS.NET on. Go to:

    {x]:Program FilesMicrosoft Visual Studio.NETVb7VBWizardsHTMLPageTemplates1033HTMLPage.htm

    and just change that to include whatever you want. Obviously you can do this with the other templates in that directory as well. I'm just focusing on the HTML template.

    To add an additional template, here are the steps I used (please change HTMLExamplePage to whatever you like):

    1. Copy the "HTMLPage" directory (as listed above) to an "HTMLExamplePage" directory in the same folder.
    2. This directory should have 2 subdirectories. One called "Templates" and one called "Scripts."
    3. Rename the template file in the copied "HTMLExamplePageTemplates1033" directory to "HTMLExamplePage.htm" or whatever you want. I don't think you necessarily have to change the name of the template file, although it probably makes the most sense. Edit the file to include whatever HTML you want your template to have.
    4. Move to the "Scripts1033" subdirectory and there will be a "default.js" javascript file.
    5. Edit this file. On line 11, change "HTMLPage.htm" to whatever you called your template file
    6. Now we need to move up to the "Vb7VbProjectItems" directory (in Microsoft Visual Studio.NET).
    7. File copy "HTMLPage.vsz" to "HTMLExamplePage.vsz." Edit the file by changing "Param="WIZARD_NAME= HTMLPage" to "Param="WIZARD_NAME = HTMLExamplePage"
    8. Still in the "VbProjectItems" directory, go to the "Web Project Items" subdirectory.
    9. Open the "WebProjectItems.vsdir" file (Notepad or VS.NET will open it).
    10. This file tells VS.NET how to show all the "Add New Item" items. Scan down through the file to the following line:

      ..HTMLPage.vsz|{164B10B9-B200-11D0-8C61-00A0C91E29D5}| #3070 |70|#3071|{164B10B9-B200-11D0-8C61-00A0C91E29D5}|4537| |HTMLPage.htm
    11. Duplicate this entry in the WebProjectItems.vsdir file (I just copied it right below the original).
    12. Change it to reference your new template.

      ..HTMLExamplePage.vsz|{164B10B9-B200-11D0-8C61-00A0C91E29D5}|Example Page|70|#3071|{164B10B9-B200-11D0-8C61-00A0C91E29D5}|4537| |HTMLExamplePage.htm
    13. If you want to know more about vsz or vsdir files, please see the VS.NET help. These steps may not work with all file types, but they do work with HTML templates. I would expect they will work with aspx templates as well, although I haven't tested that yet.
    14. You will notice I also changed #3070 to Example Page. This entry controls what shows up in the "Add New Item" dialog box so you can differentiate your template from the normal "HTML Page" template.
    15. Restart VS.NET and open a Web application. When you do "Add New Item," your template should now be in the list.

    You can do a whole lot of things with templates in VS.NET, although my knowledge at this point is limited. This is barely scratching the surface. However, I had to dig around a bit to figure this out, so I thought I would share this info.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More ASP Code Articles
    More By aspfree

     

    IBM® developerWorks developerWorks - FREE Tools!


    Be the first to hear about i5/OS V6R1!

    Hold your calendar on January 30, 2008 for this free webcast on the new i5/OS. Rational's Enterprise Modernization products will be discussed at this webcast as they help to drive the application development environment for this new System i OS. <br />And learn how i5/OS will take you to the next step of efficient, resilient business processing. You will hear about the new i5/OS capabilities as it will be the most significant i5/OS release in years. If you cannot join the webcast on 1/30/08 you can still use this link to listen to the replay.<br />
    FREE! Go There Now!


    NEW! Application Development Tools for the Mainframe Developer

    You probably have thousands of lines of COBOL code loaded with business intelligence and being used to run your business, along with an army of developers maintaining these applications. Learn how to prepare your applications and developers so you can keep that competitive edge and move to a service-oriented architecture with the IBM Rational Enterprise Modernization solutions. Replay is available for 9 months.
    FREE! Go There Now!


    NEW! Discovering the value of WebSphere Process Server

    WebSphere Process Server delivers a unique integration framework that simplifies existing IT resources. Often, as IT assets grow to support business demand, so too does their complexity and manageability. In this webcast, we’ll discuss how WebSphere Process Server helps deliver an SOA infrastructure that provides a common model to orchestrate, mediate, connect, map, and execute the underlying IT functions. Discover how WebSphere Process Server simplifies integration of business processes by leveraging existing IT assets as reusable services without the complexities of traditional integration methodologies.
    FREE! Go There Now!


    NEW! Hello World: Monitor a simple business process using WebSphere Business Monitor V6.0.2

    This tutorial shows new users of IBM WebSphere Business Monitor Version 6.0.2 how to perform the "Hello World" equivalent for monitoring business process applications. It is intended to help you get familiar with the capabilities of the product.
    FREE! Go There Now!


    NEW! IBM Enterprise Modernization Sandbox for System z: Architecture

    Analysts, architects, and developers who have existing COBOL or PL/I skills and want to extend those skills to deploy new workloads on the mainframe can use the IBM Enterprise Modernization Sandbox for System z to find hands-on walkthroughs of common real world scenarios. The scenarios provide examples of how to rapidly design, create, assemble, test, and deploy high-quality Web, Web services, portal, and SOA applications for IBM CICS, IBM IMS, and IBM WebSphere Application Server.
    FREE! Go There Now!


    NEW! Rational Modeling Extension for Microsoft.Net

    Rational Modeling Extension for Microsoft .NET enhances usability for code generation supporting a more intelligent refactoring. The latest enhancements enable organizations with Java and .NET systems and software development maintain architectural integrity across heterogeneous platforms.
    FREE! Go There Now!


    NEW! Webcast: Accelerating Software Innovation with System z

    Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, where he will overview Rational’s new offerings and programs to help customers accelerate software innovation on System z. He will discuss how these solutions help organizations extend their core business processes toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time.
    FREE! Go There Now!


    NEW! Webcast: Calling All Testers! Find Application Vulnerabilities Early in the Development Process Where they are Easier to Fix and Less Risky to your Business

    In this webcast, IBM Rational will discuss the importance of Web application security and will share techniques and best practices to introduce application security testing into current QA processes including: understanding common security vulnerabilities and techniques to integrate security testing with defect tracking and remediation systems in an effort to safeguard sensitive online information.
    FREE! Go There Now!


    NEW! Webcast: Eclipse: Empowering the universal platform

    The Eclipse community is constantly working to extend Eclipse's functionality. In this webcast, learn about some of the most important and feature-rich projects under development. From multi-language support to plug-in development, tune in to see what Eclipse is capable of now.
    FREE! Go There Now!


    NEW! Webcast: IBM Rational Build Forge - Beyond the Build

    The discipline of assembling and delivering software is maturing beyond standard developer-centric compile/test software builds. The end-to-end software development lifecycle is emerging as the new focus moves “Beyond the Build.” Join this on demand webcast to learn about methods for streamlining software delivery and key capabilities of the IBM Rational Build Forge framework for automating build and release management in environments of any size.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    ASP CODE ARTICLES

    - ASP Forms
    - ASP: The Beginning
    - Getting Remote Files With ASP Continued
    - Inbox and Outbox Manipulation in ASP
    - Relational DropDownList Using VB.NET
    - Ad Tracking URL Hits
    - Use ViewState to display one record per page...
    - Send Email using ASP.NET formatted in HTML
    - ASP File Explorer
    - ASP/XML Interview questions by Srivatsan Sri...
    - Various methods of setting Date values to a ...
    - Conditional DataGrid Item and using checkbox...
    - Fill .NET Listbox with SQL DataReader
    - Filling Dropdown box using Code-Behinds in C#
    - FLAMES code sample written in .NET What is F...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway