开发者

Shortcuts for web controls and HTML snippets in Visual Studio

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.

Shortcuts for web controls and HTML snippets in Visual Studio

Then hit Tab

Shortcuts for web controls and HTML snippets in Visual Studio

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 开发者_Python百科and ASP.NET MVC projects.

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


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.


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.


Yeah, this is a really cool new set of snippets in VS2010. Here are the articles I used to learn it:

  1. Walkthrough: Using HTML Snippets
  2. Using HTML Code Snippets in Visual Studio 2010
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜