<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d8211560\x26blogName\x3dTech+Tips,+Tricks+%26+Trivia\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://mvark.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://mvark.blogspot.com/\x26vt\x3d-5147029996388199615', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
An architect's notes, experiments, discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks


Why are these Visual Studio Settings not enabled by default?

Enclosing HTML attribute values within quotes is one of the steps to make your web pages XHTML compliant. The benefit of making your web pages XHTML compliant is that there is a high probability that your pages would become cross-browser too. ScottGu pointed out a tip from the Visual Web Developer MSDN blog (Tip#66) about a Visual Studio 2008 setting that can automatically enclose property values in the HTML editor within quotes while you are typing.
To set this option select Tools->Options. Check Show all settings. From the left pane select Text Editor -> HTML -> Format and check the insert attribute value quotes when typing checkbox.

This is no doubt a cool tip but as an aggrieved reader of that blog post mentioned, why is this nifty, time-saving option not enabled by default?

Similarly, don't we wish any HTML code that we pasted into VS is automatically formatted? Tip #59 -
In Tools->Options dialog, go to Text Editor->HTML->Miscellaneous page. Check ‘Format HTML on paste’ option.

Also, don't we want the Solution Explorer to always show the file currently opened in the Editor highlighted especially when there are a lot of files in the solution?
On the Tools - Options - Projects and Solutions - General page, there's the Track Active Item in Solution Explorer. When enabled, this will sync your solution explorer with the open document.

These small settings can make a big difference for most developers and I wish these were enabled by default.

On a related note, if you are looking for more tips on the VS.NET IDE, check Sara Ford's Visual Studio 2008 Tips and those on the Visual Web Developer MSDN blog. My favorite in the later are:
Tip #23: Did you know…How to launch Formatting options dialog for editor with 2 clicks?
Tip #24: Did you know…You could display CSS/HTML errors as warnings or as errors?
Tip #28 - Did you know… That “Go to definition” is supported for CSS Class?

Also see:
HOW TO achieve XHTML compliance by changing existing HTML code in upper case to lower
VS.NET 2005 keyboard shortcuts

Labels: ,

Tweet this | Google+ it | Share on FB

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »

»

Post a Comment