简体   繁体   English

如何在编辑.aspx文件时使用Visual Studio的“代码片段”功能?

[英]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. 我在编辑c#代码时非常重视Visual Studio的“代码片段”功能。 I always wished I could use them while typing out my aspx markup. 我一直希望在键入我的aspx标记时可以使用它们。

Is there a way to enable code snippet use in an aspx file editor window? 有没有办法在aspx文件编辑器窗口中启用代码片段?

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! 我可以激活片段,标签两次,继续前进!

That would be brilliant! 那将是辉煌的! I'd recommend the world's simplest code generato r, or CodeSmith, or maybe T4 (although I haven't tried it yet). 我推荐世界上最简单的代码生成器 ,或CodeSmith,或者T4 (虽然我还没有尝试过)。 Doesn't quite do what you'd like, but it does make it a little easier 不是你想做的,但确实让它变得容易一些

Perhaps you might think of trying Coderush which has a lot more to offer than the basic snippets found in VS. 也许你可能会想到尝试Coderush ,它提供了比VS中发现的基本片段更多的东西。 It's template facility can operate in vb, cs, aspx, html, xml and sql files. 它的模板工具可以在vb,cs,aspx,html,xml和sql文件中运行。

CodeRush Express现已免费 ,您可以从此链接下载

在PDC 2008上,来自微软的Jeff King在下一个Visual Studio 2010中展示了HTML Snippets功能的演示。但是,我对CodeRush进行了另一次投票,它更强大,你可以立即使用它。

Since I can't afford the $249 for CodeRush, I started trying to build a VisualStudio Add-In. 由于我买不起CodeRush的249美元,我开始尝试构建一个VisualStudio插件。

This guy has allready done this for me: http://ardentdev.com/blog/index.php/aspxedithelper 这家伙已经为我做了这个: http//ardentdev.com/blog/index.php/aspxedithelper

@Rory-Becker Coderush is exactly what I've been looking for!! @Rory-Becker Coderush正是我一直在寻找的!

I had previously posted that Coderush costs $99, but it costs $249. 我之前发布的Coderush售价99美元,但售价249美元。

@harriyott @harriyott

Codesmith has something called Active Snippets. Codesmith有一个叫做Active Snippets的东西。 It only comes with the professional version, which costs $399 它只附带专业版,售价399美元

http://www.codesmithtools.com/features/comparison.aspx http://www.codesmithtools.com/features/comparison.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Visual Studio (2008) 中快速测试代码片段? - How can I quickly test a code snippet in Visual Studio (2008)? 如何创建代码段并将其添加到Visual Studio中的Snippet intellisense? - How can I make a code snippet and add it to the Snippet intellisense in Visual Studio? Visual Studio的代码片段:如何在其中添加逻辑? - Visual Studio's code snippet: how to add logic in it? 如何在App_Code文件夹中使用aspx文件? - How can I use an aspx file in the App_Code folder? 我可以在Microsoft Visual Studio 2010中缩小JavaScript或aspx代码 - Can I minify JavaScript or aspx code in Microsoft Visual Studio 2010 如何在Visual Studio 2008的.ASPX页中的Javascript代码中使用断点 - How to use breakpoints in Javascript code in .ASPX page of Visual Studio 2008 如何使用Visual Studio 2013在MVC 5视图中使用Webform(.aspx)文件? - how could i use webform (.aspx) file in MVC 5 Views using visual studio 2013? 如何删除Visual Studio C#Express中的代码段? - How can I delete a snippet in Visual Studio C# Express? 如何使用Visual Studio的正则表达式替换多行代码? - How can I make use of Visual Studio's regular expression to replace multiple lines of code? 如何获取aspx文件的代码? - How can I get code of aspx file?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM