.NET Tip of The Day
Learn one new .NET trick every day
Быстрое пополнение счета телефона      Login or Join

Automatically insert attribute value quotes

Visual Studio HTML/ASPX editor can save you some time if you enable option Tools | Options... | Text Editor | HTML | Format | Insert attribute value quotes when typing. When this option is enabled, once you type a name of an attribute and following "=" symbol, Visual Studio automatically inserts a pair of quotes and invokes IntelliSense menu. After that you need only to select an attribute value from the menu and hit the Enter button. It's another nice timesaver.

2/4/2008

Comments:

In my environment, this doesn't work for the class attribute on HtmlControls or for the CssClass attribute on WebControls. Has anyone else had this problem?

Mark Hildreth 2/5/2008 12:23:31 AM

Are you talking about IntelliSense menu or about quotes?

kostya.ly 2/6/2008 12:21:40 AM

Just the quotes. I don't have any css classes defined in files that VS would be aware of (I'm using a mater page from a project in a parent folder) so there should be no intellisense menu (and there isn't).

Mark Hildreth 2/6/2008 1:58:26 AM

Does quotes work for all other attributes?

kostya.ly 2/6/2008 2:22:22 PM

Yep.

Mark Hildreth 2/7/2008 7:00:26 PM

"In my environment, this doesn't work for the class attribute on HtmlControls or for the CssClass attribute on WebControls. Has anyone else had this problem?"

You need to install this update "VS 2008 Web Development Hot-Fix Roll-Up Available". You can find out more about this update here http://weblogs.asp.net/scottgu/archive/2008/02/08/vs-2008-web-development-hot-fix-roll-up-available.aspx

Sergey P. 2/10/2008 2:29:05 AM

Name
URL
E-mail
Provide your e-mail address to receive notification about new comments.
Message
HTML tags are not supported.
Please add 7 and 8 and type the answer here:
RSS .NET Tip of The Day
Subscribe to receive one tip from the .NET Tips and Tricks Community per day.
Previous Tips of The Day
The best of the .NET Tips & Tricks Community.
.NET Practitioners .NET Tips & Tricks Community
Every .NET practitioner has a trick up in their sleeve. This is the place to share it with other .NET people.
Submit a Tip
Discovered a new trick? Share it with others.
My Tips
Manage tips you authored.