Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use Visual Studio's "Code Snippet" feature while editing a .aspx file?

I use Visual Studio's "Code Snippet" feature pretty heavily while editing c# code. I always wished I could use them while typing out my aspx markup.

Is there a way to enable code snippet use in an aspx file editor window?

Are there any third party tools that perform this?

If you're familiar with code snippet definitions, this is exactly the type of thing I want to do:

<asp:TextBox ID="$var$TextBox" Text="$text$" OnClick="$var$_Click" runat="server" />

I could activate the snippet, tab twice, and move on!

like image 428
bentford Avatar asked Oct 15 '08 17:10

bentford


4 Answers

Perhaps you might think of trying Coderush which has a lot more to offer than the basic snippets found in VS. It's template facility can operate in vb, cs, aspx, html, xml and sql files.

like image 128
Rory Becker Avatar answered Nov 17 '22 05:11

Rory Becker


That would be brilliant! I'd recommend the world's simplest code generator, or CodeSmith, or maybe T4 (although I haven't tried it yet). Doesn't quite do what you'd like, but it does make it a little easier

like image 22
harriyott Avatar answered Nov 17 '22 06:11

harriyott


CodeRush Express is now free, you can download it from this link

like image 2
Vin Avatar answered Nov 17 '22 06:11

Vin


At PDC 2008, Jeff King from Microsoft showed a demo of the HTML Snippets feature coming out in the next Visual Studio 2010. However, I put in another vote for CodeRush which is more powerful and you can use it now.

like image 2
Mehul Avatar answered Nov 17 '22 05:11

Mehul