Code Reuse - Making your own Project Templates

December 7, 2008 at 3:21 PMJeffery

It seams making a Project Template is easier than I thought.

There is a very good article here that explains the process.

Seeing that, I started thinking that I could make several project templates for my Data Access web sites, or a template that has all the membership, roles, and profiles setup. Actually for that I could make several versions of web.config template with that stuff in it too.

When ever I create a site I am always adding a site map, master page, style sheet, Javascript libraries, and other things. That would make a great project template to have all that in there all ready for me to work with. You could also add all the different folders that you might use on a regular bassis. Script, Images, Styles, Themes, and other folders.

This is very exciting. I should have looked up how to do this long ago.

Anyway that's all I have for right now.

Take Care,

JefferyS

Posted in: ASP.NET 2.0+ | C# | JavaScript | Programming

Tags:

Code Reuse

November 19, 2008 at 10:21 AMJeffery

I've been very bad at keeping up on my blogging but here is another one.

I am very bad a Code Reuse. Mostly because I haven't found a good way to keep track of things. So I'm always writing the same code over and over.

The other day I was creating a style sheet in visual studio and I thought, "dummy you should make an item template for this style sheet because you always start with the same code".

I have never created an Item Template so I looked it up. It's very easy to do. You can get real complex and project templates are more involved. This morning when I received my ASP101 newsletter, there it was. A tip on how to create a Visual Studo Item Template.

So no need for me to explain it again when someone else did a fine job of saying it. But as a simple example you can take the current StyleSheet Item Template and make one of your own.

Here is what is in the StyleSheet provided by Visual Studio 2008.

body {

}

Not much to it. so lets add a few things that may be used a lot in a style sheet.

body {

    margin:0px; font-family: Tacoma, Arial; font-size:12px;

}

a {

    text-decoration:none;

}

a:hover {

    text-decoration:underline;

}

So now when you open your customized StyleSheet Item Template you have a lot more done and setup. Depending on your projects you could make style sheets for different page layouts .

Just a simple thing to do, but it will save you some time not having to cut and paste from another file.

You can do this with classes, asp.net pages, master pages, etc..

I'll also look into the project templates to see what's involved. If I can't find a good tutorial then I'll write one.

Thanks,

 

JefferyS

Posted in: ASP.NET 2.0+ | C# | JavaScript | Programming

Tags: