views:

136

answers:

2

Consider the feature in Visual Studio 2010 for snippets in the HTML Source view of a web page.

type a control name in plaintext with no markup or brackets! ... e.g. hyperlink.

alt text

Then hit Tab

alt text

Your web control has been auto-completed for you. It's up to you to fill in the other details that you need.

This works for form as well:

 <form action="default.aspx" method="post">
 </form>

This looks like a real time saver. This is supported in WebForms and ASP.NET MVC projects.

What other snippets are available in Visual Studio 2010 in the Source view of a page?

+1  A: 

Here are a ton (100's) of the short cuts in Visual Studio right from MSDN:

http://msdn.microsoft.com/en-us/library/da5kh0wa.aspx

The one thing that has been around forever but a lot of people forget about is block selection done by holding down the ALT key and use the mouse to select a block of text. Great when you want to copy/cut/delete a bunch of code that is lined up but you don't want the whole line.

Kelsey
+2  A: 

For the authoritative list of snippets, check out the VS2010 installation folders where the snippets are stored:

C:\Program Files\Microsoft Visual Studio 10.0\Web\Snippets\HTML\1033

There is one folder for ASP.NET and one for plain HTML snippets.

Also, if you use jQuery a lot, there is a set of jQuery snippets that you can add to Visual Studio as well.

Matt Peterson