Code Snippets in Visual Studio 2005
page 2 of 7
by Bilal Haidar
Feedback
Average Rating: 
Views (Total / Last 10 Days): 35103/ 46

What is a Code Snippet?

How many times have you needed to create a new property with its private field in your objects or pages? You had to copy and paste the private field and its property and change the private field name, private field data type, property name, and the property data type. The Code Snippet feature is the solution for this repetitive work. You can now insert a generic property and all you need to do is change the property and private field data types and names without the need to write the whole property and private field codes again.

So now that you know what a code snippet does, let us discover what a code snippet is. A code snippet is nothing but an XML-formatted file which has .snippet as a file extension and is registered in Visual Studio 2005 using the Snippet Code Editor. A code snippet supports replaceable values and referencing assemblies (Visual Basic.NET only). I will be showing the contents of a snippet file and how to create a new one later on in this article.

Visual Studio 2005 comes with a set of predefined code snippets. If you want to add your own code snippet, then you must use the Visual Studio 2005 Code Snippet Manager.

 


View Entire Article

User Comments

Title: developer   
Name: sunil
Date: 2009-10-27 9:23:04 AM
Comment:
very nice exmpl
Title: developer   
Name: nanda
Date: 2007-08-06 2:00:31 AM
Comment:
nice article..
Title: Developer   
Name: Stefan Leoni
Date: 2006-12-13 7:18:51 AM
Comment:
concise. Excactly what i was looking for.

Thanks.
Title: Re:   
Name: Bilal Haidar
Date: 2006-01-20 3:38:15 PM
Comment:
You can now, discuss, comment, and ask me questions related to this article at this forum:

http://bhaidar.net/cs/forums/10/ShowForum.aspx

Regards
Title: Solution Developer   
Name: Mostafa
Date: 2006-01-07 3:05:53 AM
Comment:
Good Article.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-19 10:43:07 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search