Visual Studio - quick key or snippet for <%%>

My goal is to quickly type this:

<%= %>

      

Can anyone suggest a way to make it easier in Visual Studio to insert an HTML escape block. (I'm not even sure about the name of this piece of code!)

I understand that entering text <%

in a code editor will autocomplete the escape block for me, but maybe there is an easier way to enter this block?

Maybe there is a snippet or an existing keyboard shortcut built into Visual Studio to accomplish this?

Also, it would be nice:

<%= Html.Encode() %>

      

0


source share


3 answers


Sorry, but it looks like snippets are not available for ASP.Net markup.

Of this guy



Snippets are in VS2008, available for C #, XML and VB.NET. In VS2010, this support extends to ASP.NET markup as well.

+1


source


Even if you created a snippet for this, given that VS does auto-matching, wouldn't there be more keystrokes to enter a snippet than actually typing 3 characters?



+2


source


Create a slice and use Ctrl-K, Ctrl-X (VS 2005) and this will allow you to select the slice!

+1


source







All Articles