|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionI have always wondered if there is a way to change or rather remove the default contents of the 'New Item' presented by VS.NET 2003 IDE, when I create a new file for my Microsoft .NET project. I knew that it should be somehow possible to do it, but will it take me to install a new plug-in or make more of Google to do it. I tried to check some sources for this purpose and resulted myself in experimenting with the information in the Visual Studio .NET 2003 Help Documentation. All the information given here are from my understanding on the information present in the Visual Studio .NET 2003 Help Documentation. Note: the attached files are just sample files and are not source files as you may find in other articles. Background for the articleThis article's contents are written after I went through the contents in Visual Studio .NET 2003 Help Documentation. Template Creation ProcessAs an ASP.NET developer, for this article, I would be focusing on the template for 'WebForm' using Visual Basic .NET. I hereby assume that the visitor to this article would have a good idea on how to create and use a Project using Visual Basic .NET in Visual Studio .NET 2003 IDE. You can create a new WebForm for your web project from the Visual Studio .NET 2003 by: File --> Add --> Add New Item (select the ‘WebForm’ there)
The default 'aspx' page generated by Visual Studio .NET 2003 would be as follows: <%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm2.aspx.vb" Inherits="TestWeb.WebForm2"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>WebForm2</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
</form>
</body>
</html>
I wanted the above code to be generated as follows: <%@ Page Language="vb" AutoEventWireup="false"
Codebehind="TemplateWebForm2.aspx.vb" Inherits="TestWeb.TemplateWebForm2"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>My Template</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="Author" content="Saravana Kumar S P">
<meta name="Author Mail" content="kumarsps@hotmail.com">
<!--
All sorts of stuffs that I want to put here
-->
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
</form>
</body>
</HTML>
There are two ways to play around with this.
We will see both of them in this article. Although I am most interested in the second option. Option 1: Replace the template.This is as good as a piece of a cake.
Option 2: Create a new template.Note: sample files in this article correspond to this method. This is something I was looking for days, and oops, finally got it from the Visual Studio .NET 2003 Help Documentation. To do this, close the Visual Studio .NET 2003 IDE and follow these steps in the given order:
To Do’s for this article:
HistoryTo be updated whenever I find that I have something new to be told about this article!
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||