ASP.NET Tip 1. Why do I want to write less markup code? For productivity, of course!
For more tips like this, LIVE and IN PERSON, come see us at the MSDN Roadshow !
Why type in quotation marks every time you editing markup code, such as XML or HTML? It’s two extra keystrokes, and when you aren’t using drag and drop to write your code, these extra keystrokes can slow you down, or worse, lead to typos. In Visual Studio 2010, you can make the addition of quotes around your markup attributes automatic.
This is the very first tip in a series of ASP.NET tips, which you can subscribe to here: This book of ASP.NET Tips is geared to the ASP.NET developer from novice to advanced. All the tips are categorized by level. Anything below 100 is simple, very easy beginner stuff. 100 Level means that you've worked a little bit with that technology. 200 is intermediate. 300 is advanced, 400 is deep dive. Each Friday, there will be a Living Wiki published (yes I know it's really redundantly repetitive) that contains a multiple of tips on a particular end goal - like being the best demo'er.
Setting automatic quoting is simple (and works in Visual Studio 2008,2010):
- Go to Tools, Options, Text Editor, HTML, Formatting
- Select the Checkbox - “Insert attribute value quotes when typing”.
- Click Ok.
Once you set this option, when you are typing with IntelliSense, Visual Studio will automatically have quotes popup for you, saving a few keystrokes.