Shortcuts for web controls and HTML snippets in Visual Studio - visual-studio-2010

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.
Then hit Tab
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?

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:
Walkthrough: Using HTML
Snippets
Using HTML Code Snippets in Visual
Studio 2010

Related

Is there a feature in VIsual Studio or Resharper that can extract XAML into a separate file?

In ASP.NET Forms and MVC, you can select a block of code and extract it into a separate user control or file using Resharper and possibly Visual Studio. I cannot find such a feature for XAML. Does it exist in either Resharper or Visual Studio? If so, how do you perform this action?
I think you are looking for this:
https://www.jetbrains.com/help/resharper/ReSharper_by_Language__XAML__Refactorings.html
Resharper allows you to extract styles and resources, but you have to select the XAML and go to Resharper->Refactor->Extract in order to find the options, you won't see them if you use ALT+ENTER.

Paste HTML between <code><pre></pre></code> in Visual Studio 2013

I am developing HTML lessons for a youth summer camp and I would like to copy HTML snippets from source view then paste them in design view between <code><pre></pre></code> and have Visual Studio 2013 automatically replace < > with < > accordingly.
I researched and found the article Paste Operations in the HTML Designer of Visual Web Developer and it indicates there is an additional option in the edit menu called paste alternative but as you can see in this screenshot, there is no such option. Is it possible to change a setting or something to add such an option?
I'm not sure of your Visual Studio specific feature but Try this:
http://r12a.github.io/apps/conversion/
Will "Copy as HTML" vs2013 extension will help you?
https://visualstudiogallery.msdn.microsoft.com/98fef791-eb65-4cdf-bf84-077b98c234cf

How to insert code snippet for Debug.WriteLine(); in Visual Studio?

I can simply insert code snippet for the Console.WriteLine(); by just using the cw with Tab + Tab. But I'm not able to find the same option for the Debug.WriteLine();.
I want to know how can we customize the code snippet template in Visual Studio for Windows Phone?
In Visual Studio 2010 (and assuming other versions as well), there is not a snippet for Debug.WriteLine(). In that case, you'll need to create a custom snippet. Fortunately, it isn't that hard with the available resources:
MSDN: Creating and Using IntelliSense Code Snippets
The Snippet Editor
Snippet Designer (Visual Studio Extension) and the related CodePlex Site
If you're using ReSharper, then Code Templates and specifically Live Templates are a quick and easy option.

Visual Studio Environment intellisence offers duplicate tags. Are they the same?

when editing an aspx page in visual studio the intellisence offers auto insertion of the usual asp:tags, but it also offers some tags that are not prefixed with asp: and not regular html. For instance, it offers an updatepanel tag, loginview tag and an image tag. Are these some sort of short-hand for adding asp.net web controls?
I have tested this and it doesn't do anything. After adding the tag visual studio's intellisence doesn't suggest any attributes and it doesn't render any sort of output to the client. Still not sure why intellisence suggest them, but they aren't server controls.

How do I get triple click to work in Visual Studio's Text Editor

Go into Notepad, Internet Explorer or most other applications that display or edit text. Triple click on some text. Windows will select the entire paragraph under the cursor.
This doesn't work in Visual Studio 2005.
How do I get triple click support in the Visual Studio text editor?
do VS 2008 or VS 2010 solve this?
Is there a macro, setting or plugin that will solve this?
I wrote an extension for this for Visual Studio 2010 that you can download from the VS Gallery or directly from the extension manager in Visual Studio, by searching for "triple click" or my name.
You can also read the blog post I wrote about it and check out the source, on github.
I haven't used it, but CodeProject has an article on SmartHelp 3.04 which mentions that you can triple click to select a whole line.
Also, from Craig Shoemaker's blog.
About VS 2010.
Further enhancements include the
ability to triple-click an expansive
element like a table and the editor
selects the entire table’s markup.
Want to surround that table with some
additional markup? Just start typing
with the table selected and your
markup is inserted around the selected
code.

Resources